IntelliJ的golang插件中的“系统环境”是什么意思?

jayunit100:

在此处输入图片说明我试图使用intellij的golang插件,但是它说没有定义GOPATH。

  • 该插件允许您配置某种“ GO Libraries”窗口,但是
  • 目前尚不清楚配置的含义,也没有关于应输入内容的工具提示。
  • 定义了“全局库”,“项目库”等。

就我而言,我只想使用GOPATH。

随附的屏幕截图:这里的主要问题:使用intellij的Golang插件时,如何以及在哪里设置GOPATH?

Some context: I don't mind setting gopath globally on my mac, but it seems that is a heavy-handed approach for an IDE to use**

dlsniper :

the Go plugin currently uses the term Go Libraries for different GOPATH values. If you have a single GOPATH that you'd like to use for all the projects, then you can add it to the "Global Libraries". For example, my $GOPATH is /home/florin/golang and in the plugin I've set the Global Libraries from the Go Libraries setting to reflect that (see this screenshot).

单个GOPATH手动设置

If the plugin can automatically detect the GOPATH, and you have the check box ticked for that, then the plugin will try and use that value as the GOPATH value, see the next screenshot

自动检测到的GOPATH

Also, the plugin has three different types of GOPATH values right now:

  • the Global Libraries -> you should set GOPATH entries here for GOPATH values that you want to share between different projects (most use-cases)
  • Project Libraries -> you should set the GOPATH entries here for GOPATH values that are specific to the current project only (when you want to have a single GOPATH per project approach)
  • Module Libraries -> this is a very specific setting, it's only used in case you have different modules in your project and you want to have a different GOPATH configuration for each of the modules. The module in this case is a specific logical grouping of the source code in the IDE, not in the packages that the Go project uses (think of the ability to have a Python module, a Go module and an Android module all in the same project).

有一张票证计划进一步简化此操作,您的输入将包括在内。

希望能帮助到你。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章