Reputation: 8103
trying to run a go test code and have this issue. It has import like this:
"github.com/abcd/abcd"
Then, when I run it, it failed to find the package.
I noticed this is a common practice to import github stuff like this. For me, what is the right the way to handle it?
thanks.
Upvotes: 0
Views: 1102
Reputation: 48330
This should download the repository inside your gopath
mkdir -P $PWD/gopath/{bin,src,pkg}
export GOPATH=$PWD/gopath:$GOPATH
go get "github.com/abcd/abcd"
ls gopath/src/github.com/abcd/abcd
If you tell us what specific repository you may get more accurate info on how to accomplish your task
Upvotes: 2