如何知道 Bazel Build 中使用的 golang 版本?

huangapple go评论86阅读模式
英文:

How to know which version of golang is used in Bazel Build?

问题

在执行bazel build //...命令构建一个Golang项目时,有没有办法打印出Golang的版本?如果没有,有没有办法配置bazel使用的Golang版本?

英文:

When performing a bazel build //... for a golang project, is there any way I can print the golang version? If not, is there any way to configure which version of golang is used by bazel?

答案1

得分: 1

你应该能够在你的 Bazel WORKSPACE 中使用 go-register-toolchains 规则 配置 Go 版本,例如:

go_register_toolchains(version = "1.15.5")
英文:

You should be able to configure the Go version in your Bazel WORKSPACE using the go-register-toolchains rule, e.g.:

go_register_toolchains(version = "1.15.5")

huangapple
  • 本文由 发表于 2021年5月26日 22:34:36
  • 转载请务必保留本文链接:https://go.coder-hub.com/67707095.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定