[英]no stdlib hinting in Goland IDE with custom GOPATH and govendor
I'm using Goland 2017.3 with Go 1.9.2, and have a custom GOPATH with govendor that replicates the DigitalOcean monorepo, as explained here: https://blog.digitalocean.com/cthulhu-organizing-go-code-in-a-scalable-repo/ 我将Goland 2017.3与Go 1.9.2一起使用,并具有带有govendor的自定义GOPATH,可复制DigitalOcean monorepo,如此处所述: https ://blog.digitalocean.com/cthulhu-organizing-go-code-in-a -scalable-repo /
The structure looks like this: 结构如下:
gocode
├── .env.sh
├── bin
├── src
│ └── acmecorp
│ ├── teams
│ └── vendor
├── pkg
and .env.sh
looks like this: .env.sh
看起来像这样:
SCRIPT=`python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" "${0}"`
GOCODE=$(dirname $SCRIPT)
export GOPATH="$GOCODE"
export PATH="$PATH:$GOPATH/bin"
I have no issue building code with source .env.sh
and govendor build
. 我没有问题用
source .env.sh
和govendor build
构建代码。 govendor
resolves all dependencies and builds the project. govendor
解决了所有依赖关系并构建了项目。
However, when I attempt to set up GOPATH
in GoLand and set PROJECT GOPATH
to $HOME/gocode
, GoLand stops recognizing the stdlib because it starts looking for the stdlib in vendor
: $HOME/gocode/src/acmecorp/vendor/time has no buildable Go source files
. 然而,当我试图建立
GOPATH
中的Goland并设置PROJECT GOPATH
至$HOME/gocode
,的Goland终止确认该STDLIB,因为它开始寻找在STDLIB vendor
: $HOME/gocode/src/acmecorp/vendor/time has no buildable Go source files
。 If I remove the PROJECT GOPATH
it finds the stdlib but not the code in the mono repo. 如果删除
PROJECT GOPATH
它将找到stdlib,但找不到单存储库中的代码。
How can I get GoLand to stop looking in vendor
for the stdlib? 如何让GoLand停止在
vendor
寻找stdlib?
Edit: GOROOT
is kept as standard in the IDE: screenshot of GOROOT 编辑:
GOROOT
在IDE中保留为标准设置: GOROOT的屏幕截图
Please open an issue on the tracker tracker https://youtrack.jetbrains.com/issues/Go and attach the IDE logs via Help | 请在跟踪器跟踪器https://youtrack.jetbrains.com/issues/Go上打开一个问题,然后通过“帮助” |“附加”添加IDE日志。 Collect and Show Logs in.... You can lock the visibility of the logs to
jetbrains-team
and GoLand team
only so that the logs are not publicly accessible. 收集并显示日志。...您只能将日志的可见性锁定到
jetbrains-team
和GoLand team
,以使日志不可公开访问。
This looks either like a bug in the IDE or a configuration issue on your side but it's hard to tell which without logs. 这看起来像是IDE中的bug或您身边的配置问题,但是很难确定没有日志的情况。 Thank you.
谢谢。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.