I have a go project which consists of several packages. First, the main package located at $GOPATH/src/myproject/main.go
, and then an auth package located at $GOPATH/src/myproject/auth/<filename>.go
. The main package references the auth package with an import "myproject/auth"
. Local build goes fine.
Now I try to use this project build with Travis CI, especially to learn more about Travis. Apparently Travis expects import
statements which don't start with a hostname to be available from beginning, since I get the error package myproject/auth: unrecognized import path "myproject/auth" (import path does not begin with hostname)
.
On my local machine this is no problem, since my local go knows about its available sources in $GOPATH
, and so about the project's subpackage, too, and just includes the sources.
What are the expected steps to do to make Travis work with this import statement as well?
Why not to use full path in import? It does not lead to any problem, right? It works just fine both local and with CI (hopefully)