go install: no install location for directory outside GOPATH

前端 未结 3 439
隐瞒了意图╮
隐瞒了意图╮ 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:26

    I had the same problem in Windows 10,

    So I set a system variable named GOBIN with absolute value F:\go\bin.

    Then ran go install main.go and everything worked perfectly fine!

提交回复
热议问题