wedge
According to experience, we know that go get can be used to install modules, and modules are divided into two categories, one is ordinary code dependencies, and the other is executable binary tools. The two types of modules are placed in different folders, the first type of code dependencies are usually placed in the $GOPATH/pkg/mod
folder, and the second type of modules are usually placed $GOPATH/bin
in the path.
Today, when I used the go get command to install the binary tool according to the tutorial, although it was prompted that the installation was complete, the actual use kept saying that the command was not found. Check the path, and there is no $GOPATH/bin
package just installed. I guess the installation failed.
resolution process
Then guess whether you need to use go install to install the module. After trying it, it is successful. It seems that you need to use the go install command to install the binary toolkit after go 1.17, but you can still use the command to install the module of the code-dependent class go get
.
by the way
Upgrade the module package version, go get -u xxx
orgo install -u xxx