简体   繁体   中英

go import github, how to set up?

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM