[英]Compile glide vendored packages
Golang's glide downloads dependencies to the project's source. Golang的滑行将依赖项下载到项目的源代码。 As a result,
go build
compiles those too, and go plugins that lint/vet the codebase also parse the dependencies. 结果,
go build
也会对它们进行编译,而lint / vet代码库的go插件也会解析依赖项。
Assuming those dependencies are stable, how can I compile the dependencies so go build
becomes faster? 假设那些依赖项是稳定的,那么我该如何编译这些依赖项,以使
go build
变得更快?
Also, how can I remove vendor/
from go's tools to lint and check the codebase for errors? 另外,如何从go的工具中删除
vendor/
去掉毛绒并检查代码库中的错误?
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
有没有一种方法可以预编译我的依赖项(获取.a)文件,因此在运行go install或go build时可以更快地进行编译
See https://golang.org/cmd/go/#hdr-Compile_packages_and_dependencies 参见https://golang.org/cmd/go/#hdr-Compile_packages_and_dependencies
go build [-o output] [-i] [build flags] [packages]
进行构建[-o输出] [-i] [构建标志] [软件包]
[...] [...]
The -i flag installs the packages that are dependencies of the target.
-i标志安装作为目标依赖项的软件包。
Also, how can I remove vendor/ from go's tools to lint and check the codebase for errors?
另外,如何从go的工具中删除供应商/去掉毛绒并检查代码库中的错误?
See https://github.com/golang/go/issues/11659#issuecomment-122139338 : 参见https://github.com/golang/go/issues/11659#issuecomment-122139338 :
Instead of using ./... you can do:
除了使用。/ ...,您还可以执行以下操作:
go install $(go list ./... | grep -v /vendor/)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.