GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub?
to your account
I ran some go build commands just now in a new module and there is not a go version in my go.mod. There should be.
/cc @bcmills @jayconrod
That was an intentional change in behavior for #30790.
We now add the go directive only in go mod init and go mod tidy
go mod init
go mod tidy
Per discussion with Russ, we should go with the alternative described in #30790 (comment): we should always write the go version if it isn't present.
Change https://golang.org/cl/176925 mentions this issue: cmd/go: always add 'go' directive to the go.mod file if missing
cmd/go: always add 'go' directive to the go.mod file if missing