我正在尝试安装“goinstall github.com/alloy-d/goauth”,但它不工作。出现以下错误。
goinstall github.com/alloy-d/goauth
'goinstall' is not recognized as an internal or external command,
operable program or batch file.
我也尝试了 git 克隆,但它没有创建精确的结构。
git clone git://github.com/alloy-d/goauth
正在将它安装在“$GOPATH”中
最佳答案
明确地说,goinstall
曾经存在(现在是“go get
”)。
如“Configuration versus convention”中所述:
Over the last few years we consistently reminded people about the
goinstall
command (now replaced by go get) and its conventions:
- first, that the import path is derived in a known way from the URL of the source code;
- second, that the place to store the sources in the local file system is derived in a known way from the import path;
- third, that each directory in a source tree corresponds to a single package;
- and fourth, that the package is built using only information in the source code. Today, the vast majority of packages follow these conventions.
因此您会发现使用“goinstall
”的旧教程。
但在您的情况下,go get
然后 go install
会更好。
或者 go install -v github.com/alloy-d/goauth
查看详细信息(编译时包的名称)。
关于goinstall 不被识别为内部或外部命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26601205/