Featured

TechBytes on Linux

This is a growing list of Linux commands which might come handy for the of Linux users. 1. Found out i had to set the date like this: ...

Sunday, March 26, 2023

Go error: go : go.mod file not found in current directory or any parent directory; (working on GOPATH/src)

As of Go 1.16, the GO111MODULE environment variable is treated as "on" by default, meaning Go expects to find a go.mod file, and no longer falls back to pre-module GOPATH behavior.

If you want to go back to the pre-1.16 behavior, you now have to explicitly specify GO111MODULE=auto, but you're far better off creating a go.mod file.

See https://golang.org/doc/go1.16#go-command and https://golang.org/ref/mod


Source - https://stackoverflow.com/questions/67929883/go-error-go-go-mod-file-not-found-in-current-directory-or-any-parent-director 

No comments:

Post a Comment

Popular Posts