gpt4 book ai didi

go - 编译 glide 销售包

转载 作者:IT王子 更新时间:2023-10-29 02:23:40 25 4
gpt4 key购买 nike

Golang 的 glide将依赖项下载到项目的源。因此,go build 也会编译它们,并且检查/检查代码库的 go 插件也会解析依赖项。

假设这些依赖关系是稳定的,我如何编译这些依赖关系以便 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/)

关于go - 编译 glide 销售包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33688705/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com