dongyan9838 2015-05-08 06:28
浏览 876
已采纳

liteide在运行时将GOROOT设置为GOPATH

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.

  • 写回答

1条回答 默认 最新

  • duankanjian4642 2015-05-08 07:11
    关注

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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
  • ¥15 乘性高斯噪声在深度学习网络中的应用
  • ¥15 运筹学排序问题中的在线排序
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛