Tuesday, September 8, 2020

Go install fails with error: no install location for directory xxx outside GOPATH

 C:\Users\UdayKiranReddy\go\src>go install

go install: no install location for directory C:\Users\UdayKiranReddy\go\src outside GOPATH

        For more details see: 'go help gopath'


If you see above error.


Then set this variable before running "go install"


set GOBIN=%GOPATH%\bin

Then, go install works and the compiled exe will be saved to the GOBIN folder.

Reference

No comments:

Post a Comment