go install: no install location for directory outside GOPATH

前端 未结 3 424
隐瞒了意图╮
隐瞒了意图╮ 2021-01-03 18:54

I installed the Go, then added path requirements to my .bash_profile:

  • export PATH=$PATH:/usr/local/go/bin
  • export GOPATH
3条回答
  •  孤城傲影
    2021-01-03 19:31

    The problem was as James Henstridge commented, for some reason there was an issue with my user directory name case. Even though the directory is lowercase, I had to make it capitalized.

    This worked:

    GOPATH=/Users/Daryl/go

    This didn't:

    GOPATH=$HOME/go

    However, since moving to a rMBP from my iMac, I had no problems whatsoever setting up Go, so, to this day, I'm not sure what was going on, but in that instance the capitalization fixed it.

提交回复
热议问题