dtwr2012 2013-08-28 03:37
浏览 20
已采纳

使用Go with fish fish shell-运行`go install / path / to / src`时出错

I am following the "How to Write Code" portion of the golang docs, here. I am also using fish fish shell.

I have followed the tutorial and set the proper environment variables (GOPATH and PATH) but I can't get the command go install github.com/user/hello to work with my installation.
I am getting an error:

can't load package: package github.com/user/hello: import "github.com/user/hello": cannot find package

  • 写回答

2条回答 默认 最新

  • doudang2817 2013-08-28 03:37
    关注

    I had, in fact, incorrectly set my environment variables. Specifically, when setting GOPATH in my ~/.config/fish/config.fish file I needed to export the variable.

    Put these lines in your config.fish for fish shell to use Go:
    set -x GOPATH $HOME/path/to/your/workspace

    Note the -x. That was what was missing.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 Python爬取指定微博话题下的内容,保存为txt
  • ¥15 vue2登录调用后端接口如何实现
  • ¥65 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥15 latex怎么处理论文引理引用参考文献
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?