Cannot set $GOPATH on Mac OSX

前端 未结 7 1161
迷失自我
迷失自我 2020-12-22 23:34

I\'m trying to set my $GOPATH variable to run some example code on my machine:

$ smitego-example go run main.go 
main.go:5:2: cannot find packag         


        
7条回答
  •  执念已碎
    2020-12-23 00:18

    After installing go with brew or with package this solved my problem:

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

提交回复
热议问题