gpt4 book ai didi

go - liteide 在运行时将 GOROOT 设置为 GOPATH

转载 作者:IT王子 更新时间:2023-10-29 01:10:48 28 4
gpt4 key购买 nike

在开发过程中,这种愚蠢的行为开始了,现在看来是永久性的。我不知道发生了什么:

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

liteide 构建错误:

 ../../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)

什么?为什么使用 GOPATH 代替 GOROOT?这曾经有效,并且在 liteide 运行时神秘地切换到损坏的 ,从一个构建到另一个构建,几秒钟后......

有人看过吗?有什么方法可以在 liteide 中检查/设置 GOROOT?

[编辑] 更奇怪的是:我认为 GOPATH 末尾的/可能会混淆它,所以我删除了它。现在:

 [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)

痛苦。

最佳答案

您可以在 /usr/share/liteide/liteenv/linux*.env 中检查是否设置了 GOROOT(可以是 issue as reported in here )
您还可以检查是否 GOROOT is set in other place as well .

最后检查 latest liteide (x27.2.1) 问题是否仍然存在.


OP BadZen确认 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).

关于go - liteide 在运行时将 GOROOT 设置为 GOPATH,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30117155/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com