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

报告相同问题?