If you are like me and getting errors while trying to compile your go lang code without having a
package src is not in GOROOT (/usr/local/Cellar/go/1.18.3/libexec/src/src)
Remember you have overlooked a basic change that happened post
go command now builds packages in module-aware mode by default, even when no
go.mod is present.
> go env|grep GO111 GO111MODULE=""
Set it off
go env -w GO111MODULE=off
go test PASS ok _/Users/samarthya/sourcebox/github.com/git.golang/project-one/src 0.099s
You can also set
auto to enable module-aware mode only when a go.mod file is present in the current directory or any parent directory.
go env -w GO111MODULE=auto