因为 go get 第一步就是 download 远程的库,如果就就想要使用本地的版本,go get 是办不到的,所以如果你不需要 download 你需要就可以使用 go install
go install 是有应用场景的
参考:https://stackoverflow.com/questions/24878737/what-is-the-difference-between-go-get-and-go-install
提示:在新版本的 go 1.15 go install 如果本地没有 package 会自动从远程下载包,所以是十分方便的
go install, with or without a version suffix (as described above), is now the recommended way to build and install packages in module mode. go get should be used with the -d flag to adjust the current module’s dependencies without building packages, and use of go get to build and install packages is deprecated. In a future release, the -d flag will always be enabled.
参考: https://tip.golang.org/doc/go1.16#modules