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

前端 未结 25 2949
死守一世寂寞
死守一世寂寞 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:00

    At the end of the ~.profile file add::

    export GOPATH="$HOME/go"
    export PATH="$PATH:/usr/local/go/bin"
    export PATH="$PATH:$GOPATH/bin"
    

提交回复
热议问题