Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

golang go get unrecognized import path

Tags:

go

When I tried to run go get in a golang project root path ChaatzFeaturePhoneServer. It prompts

  go get
  package FeaturePhoneServer/routers: unrecognized import path "FeaturePhoneServer/routers"

I am rather confused about it. What is the possible cause of it? How can I find out the cause and fix it?

like image 317
Peter Hon Avatar asked Aug 18 '14 16:08

Peter Hon


1 Answers

Check your GOPATH environment variable:

go expect to find FeaturePhoneServer/routers in $GOPATH/src (see go build)
Avoid relative import paths.

If the error persists, you can also check your GOROOT and go installation, as in this question.

like image 187
VonC Avatar answered Nov 16 '22 02:11

VonC