golang - 用IDE看docker源码时的小问题
过去多啦不再A梦
过去多啦不再A梦 2017-04-25 09:02:23
0
1
621

用了intellij + golang插件,配置好GO SDK和项目为GO项目后,把project的GOPATH设到了vendor目录

发现import中很多还是红色的,从github clone下来的项目verdor/src并不全,不知道是不是我操作有问题,通过go get拿全了src后,import下就全绿了,没问题。

但是还是有极少数的几个地方是红的,比如container/container.go,daemon/daemon.go

找不到其定义的位置,请教是IDE问题还是我设置问题,或者是别的什么,谢谢

过去多啦不再A梦
过去多啦不再A梦

reply all(1)
仅有的幸福

I solved the problem as soon as I mentioned it. It was because the system was not selected in the build tag. I just set it to Linux, but the default one didn’t work.
The file can be modified under the .idea project iml.

<buildTags>
    <option name="os" value="linux" />
</buildTags>

The reason is because there are multiple Container structs in the container directory, container_solaris/container_unix/container_windows. Without setting os, the IDE will not know which struct to use

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template