goのバージョン(1.16.5)を上げたらgo: cannot find main module, but found .git/config in /xxx/yyy IT by NHM - 2021-07-082021-07-08 go buildしたらgitかと思うエラーが出た。 go: cannot find main module, but found .git/config in /xxx/yyy to create a module there, run: cd ../.. && go mod init 結論からいうと環境変数に下記を追加する。 export GO111MODULE=auto 参考にしたページ。参考というか答えが書いてあった Go test results in go: cannot find main module, but found .git/config in /Users/dp/Documentshttps://stackoverflow.com/questions/67306638/go-test-results-in-go-cannot-find-main-module-but-found-git-config-in-users Share on Facebook Share Share on TwitterTweet Share on Pinterest Share Share on LinkedIn Share Share on Digg Share No tags for this post.