在Goland的IntelliJ编辑器中,可以在Go文件的顶部定义构建标签。

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

Where to define Build Tags in Goland from intellij editor?

问题

在我的Go项目中,根据Go构建标签使用了各种不同的包,例如:

使用 XXXX

//go:build XXXX
// +build XXXX

或者

不使用 XXXX

//go:build !XXXX
// +build !XXXX

我如何在使用 Goland 进行调试时定义这样的构建阶段 XXXX,根据调试的需要,例如使用 XXXX 或者不使用 XXXX?

英文:

In my go project various packages are used based on the go build tags e.g.

with XXXX

//go:build XXXX
// +build XXXX

or

without XXXX

//go:build !XXXX
// +build !XXXX

How I can define such build stage XXXX while doing debugging with goland , based on the debugging need e.g. with XXXX or without XXXX

答案1

得分: 2

请按照以下步骤进行操作:

  1. 打开 Goland。
  2. 进入 "Run/Debug configurations"。
  3. 在 "Go Tool Arguments" 中添加参数,例如:-tags build-variable-name。
  4. 保存配置。

你可以参考以下图片进行操作:
在Goland的IntelliJ编辑器中,可以在Go文件的顶部定义构建标签。

英文:

Go to Goland->Run/Debug configurations-> Go ToolArguments e.g. -tags build-variable-name

在Goland的IntelliJ编辑器中,可以在Go文件的顶部定义构建标签。

huangapple
  • 本文由 发表于 2022年5月2日 14:37:47
  • 转载请务必保留本文链接:https://go.coder-hub.com/72083122.html
匿名

发表评论

匿名网友

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

确定