go env:
![image.png](https://static.studygolang.com/200510/b2d95cb85ba9fb80b273d13fb0e1a702.png)
![image.png](https://static.studygolang.com/200510/b59cfe1695a4d6c6011426642a5a812a.png)
目录:
![image.png](https://static.studygolang.com/200510/461a384081a386a8688540ab1ffe7dd6.png)
go install main:
![image.png](https://static.studygolang.com/200510/8cdcbd4cb62fb9f2c221d0142af12eea.png)
会报错:
can't load package: package main is not in GOROOT (C:Gosrcmain)
使用go install awesomeProject/main 没问题,或者把main.go拿到根目录awesomeProject然后用go install和go install awesomeProject也都没问题。
有疑问加站长微信联系(非本文作者)