编译 glide 销售包

Compile glide vendored packages

Golang 的 glide 将依赖项下载到项目的源代码中。结果,go build 也编译了这些,并且 lint/vet 代码库也解析了依赖项。

假设这些依赖关系是稳定的,我怎样才能编译依赖关系以便 go build 变得更快?

此外,我如何从 go 的工具中删除 vendor/ 以 lint 并检查代码库是否有错误?

Is there a way to pre-compile my dependencies (get .a) files, so it is faster to compile when I run go install or go build

https://golang.org/cmd/go/#hdr-Compile_packages_and_dependencies

go build [-o output] [-i] [build flags] [packages]

[...]

The -i flag installs the packages that are dependencies of the target.


Also, how can I remove vendor/ from go's tools to lint and check the codebase for errors?

https://github.com/golang/go/issues/11659#issuecomment-122139338:

Instead of using ./... you can do:

go install $(go list ./... | grep -v /vendor/)