我用 go get,它提醒我用 go install。我用了 go install,它提醒我只能装二进制包。
```bash
$ go get github.com/gorilla/mux
go: go.mod file not found in current directory or any parent directory.
'go get' is no longer supported outside a module.
To build and install a command, use 'go install' with a version,
like 'go install example.com/cmd@latest'
For more information, see https://golang.org/doc/go-get-install-deprecation
or run 'go help get' or 'go help install'.
$ go get github.com/gorilla/mux@latest
go: go.mod file not found in current directory or any parent directory.
'go get' is no longer supported outside a module.
To build and install a command, use 'go install' with a version,
like 'go install example.com/cmd@latest'
For more information, see https://golang.org/doc/go-get-install-deprecation
or run 'go help get' or 'go help install'.
```
install包安装都是编译好的,会放到bin目录,所以都是全局的。go下载的包都是放在全局的,没有nodejs的那种放在目录下,但是可以把用的包用命令放到项目的vender目录下
#4
更多评论