9

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?

Peter Hon
  • 321
  • 2
  • 6
  • 10

1 Answers1

6

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.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250