GOPATHIf set to
vendor/srcTo get something, and
glideIs to install the code directly
vendorWhat should I do next?
GOPATHTo remain unchanged, glide only relies on the project’s designation.
Look here my answer is very clear.
GOPATHIs fixed, is an environment variable, you can write multiple paths in it, with a separator (Windows is a comma, Linux colon). When the library is loaded, a path will be found, and the finding will not continue to look down.
GOPATHHow should you match it?
http://www.lenggirl.com/tool/golang-config.html vim /etc/profile.d/myenv.sh export GOROOT=/app/go export GOPATH=/home/jinhan/code export GOBIN=$GOROOT/bin export PATH=.:$PATH:/app/go/bin:$GOPATH/bin:/home/jinhan/software/Gogland-171.3780.106/bin source /etc/profile.d/myenv.sh
go1.5Then (MAYBE) introduced the concept of vendor, a project will first find the library from the vendor of the project, and then from
GOPATHLook for it, and if there is a a library under this project, there is a B Library under the a library, a C library under the B library, and if the C library uses the D library, it will find the D library from the vendor under the C library, and can not find the bubble up to vendor…
glideThe project will package the third party library that is dependent on the main entrance of the project in vendor, which may lead to a conflict, if your project references the V library, the V library is wrapped in vendor, and your project is referenced by the w library as the third party library, and the w library will refer to the V library at this time.You import the structure variable of the V library into the function of your own library, and the parameters may not match.
I don’t know if you don’t understand it.
GOLANGThe package management is like this
You can use it, too