dongye9991 2015-11-13 08:41
浏览 62
已采纳

编译滑行供应的软件包

Golang's glide downloads dependencies to the project's source. As a result, go build compiles those too, and go plugins that lint/vet the codebase also parse the dependencies.

Assuming those dependencies are stable, how can I compile the dependencies so go build becomes faster?

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

  • 写回答

1条回答 默认 最新

  • drt3751 2015-11-13 18:10
    关注

    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

    See 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?

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

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

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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥15 stable diffusion
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条