cannot download, $GOPATH not set

前端 未结 15 2003
闹比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:51

    If you run into this problem after having $GOPATH set up, it may be because you're running it with an unsupported shell. I was using fish and it did not work, launching it with bash worked fine.

    0 讨论(0)
  • 2020-11-29 17:53

    This one worked

    Setting up Go development environment on Ubuntu, and how to fix $GOPATH / $GOROOT

    Steps

    mkdir ~/go
    

    Set $GOPATH in .bashrc,

    export GOPATH=~/go
    export PATH=$PATH:$GOPATH/bin
    
    0 讨论(0)
  • 2020-11-29 17:55

    Run 'go env' and see where your GOPATH is currently pointing towards. If you change to that directory, your 'go get..etc' command should work.

    0 讨论(0)
提交回复
热议问题