How do I SET the GOPATH environment variable on Ubuntu? What file must I edit?

前端 未结 25 2952
死守一世寂寞
死守一世寂寞 2020-11-28 00:45

I am trying to do a go get:

go get github.com/go-sql-driver/mysql

and it fails with the following error:

packa         


        
25条回答
  •  执念已碎
    2020-11-28 01:05

    This is what got it working for me on Ubuntu 15.10 using the fish shell:

    # ~/.config/fish/config.fish
    
    set -g -x PATH /usr/local/bin $PATH
    set -g -x GOPATH /usr/share/go
    

    Then I had to change the permissions on the go folder (it was set to root)

    sudo chown : -R /usr/share/go
    

提交回复
热议问题