cannot download, $GOPATH not set

前端 未结 15 2159
闹比i
闹比i 2020-11-29 17:00

I want to install json2csv using go get github.com/jehiah/json2csv but I receive this error:

package github.com/jehiah/json2csv: cannot download         


        
15条回答
  •  暖寄归人
    2020-11-29 17:44

    For MAC this worked well for me.

    sudo nano /etc/bashrc
    

    and add the below at the end of the file

    export PATH=$PATH:/usr/local/opt/go/libexec/bin
    export GOPATH=/usr/local/opt/go/bin
    

    This should fix the problem. Try opening a new terminal and echo $GOPATH you should see the correct value.

提交回复
热议问题