liteide在运行时将GOROOT设置为GOPATH

在开发会话的中间,这种愚蠢的行为开始了,现在看起来是永久的。 我不知道发生了什么事:</ p>

  [dtrombley @ sleet bin] $ echo $ GOROOT 
/ usr / lib / golang
[dtrombley @ sleet bin] $ echo $ GOPATH
/ home / dtrombley / go /
[dtrombley @ sleet bin] $ ./liteide

liteide构建错误:</ p>
\ n

  ../../github.com/Sirupsen/logrus/writer.go:4:2:在以下任何位置都找不到软件包“ bufio”:
/ home / dtrombley / go / src / bufio(来自$ GOROOT)
/ home / dtrombley / go / src / bufio(来自$ GOPATH)
</ code> </ pre>

什么? 为什么使用GOPATH代替GOROOT? 过去一直有效,并且在liteide运行时神秘地切换为损坏的 </ em>,从一个版本到另一个版本,实际上是几秒钟后... </ p>

有人 看到了吗? 有什么方法可以在liteide中检查/设置GOROOT吗?</ p>

[编辑]进一步的怪异:我认为GOPATH末尾的/可能会造成混淆,因此我删除了它。 现在:</ p>

  [dtrombley @ sleet bin] $ echo $ GOROOT 
/ usr / lib / golang
[dtrombley @ sleet bin] $ echo $ GOPATH
/ home / dtrombley / go
[dtrombley @ sleet bin] $ ./liteide
</ pre>

... </ p>

  警告:GOPATH设置为GOROOT(/ home / dtrombley / go)无效
../../ github.com/Sirupsen/logrus/writer.go:4:2:在以下任何位置都找不到软件包“ bufio” :
/ home / dtrombley / go / src / bufio(来自$ GOROOT)
(未设置$ GOPATH)
</ code> </ pre>

痛苦。</ p> \ n </ div>

展开原文

原文

In the middle of a development session, this stupid behavior started and now it looks permanent. I have no idea what happened:

[dtrombley@sleet bin]$ echo $GOROOT
/usr/lib/golang
[dtrombley@sleet bin]$ echo $GOPATH
/home/dtrombley/go/
[dtrombley@sleet bin]$ ./liteide

liteide build error:

 ../../github.com/Sirupsen/logrus/writer.go:4:2: cannot find package "bufio" in any of:
/home/dtrombley/go/src/bufio (from $GOROOT)
/home/dtrombley/go/src/bufio (from $GOPATH)

What? Why is it using GOPATH in place of GOROOT? This used to work, and mysteriously switched to broken while liteide was running, from one build to the next, literally a few seconds later...

Has anyone seen this? Is there some way I can inspect/set the GOROOT within liteide?

[Edit] Further weirdness: I thought the / at the end of GOPATH might be confusing it, so I removed that. Now:

 [dtrombley@sleet bin]$ echo $GOROOT
 /usr/lib/golang
 [dtrombley@sleet bin]$ echo $GOPATH
 /home/dtrombley/go
 [dtrombley@sleet bin]$ ./liteide

...

warning: GOPATH set to GOROOT (/home/dtrombley/go) has no effect
../../github.com/Sirupsen/logrus/writer.go:4:2: cannot find package "bufio" in any of:
/home/dtrombley/go/src/bufio (from $GOROOT)
($GOPATH not set)

Misery.

dongyan3237
dongyan3237 两条路径末尾的斜杠将还原为引用的第一个错误。
5 年多之前 回复

1个回答



您可以检查 /usr/share/liteide/liteenv/linux*.env中是否设置了GOROOT </ 代码>(可以是此处报告的问题

您 也可以检查 GOROOT是否也设置在其他位置。</ p>

最后检查 如果问题仍然存在最新的Liteide(x27.2.1)。</ p>


OP BadZen 确认在评论中:</ p>


它在会话过程中进行了切换,因为我必须迷路地单击并将目标从 linux64 </ code>切换到 linux32 </ code>- linux 32.env </ code>具有错误的 GOROOT </ code>条目( GOROOT = $ HOME / go </ code>)。</ p>
</ blockquote>
</ div >

展开原文

原文

You can check if GOROOT is set at all in /usr/share/liteide/liteenv/linux*.env (which can be an issue as reported in here)
You can also check if GOROOT is set in other place as well.

Finally check if the issue persists with the latest liteide (x27.2.1).


The OP BadZen confirms in the comments:

It switched in the middle of the session because I must have stray clicked and switched my target from linux64 to linux32 - the linux32.env had the buggy GOROOT entry (GOROOT=$HOME/go).

duanjiao6730
duanjiao6730 大! 我已将您的评论包含在答案中,以提高知名度。
5 年多之前 回复
dsadasd12132
dsadasd12132 嗯,是的,这就是问题所在。 它在会话过程中进行了切换,因为我必须迷路地单击并将目标从linux64切换到linux32-linux32.env的GOROOT条目存在错误(GOROOT = $ HOME / go)。 gh,那不应该覆盖环境。 TYVM
5 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐