Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/go: `go get` creates go.mod and go.sum files inconsistently, depending on directory #30248
What version of Go are you using (
I think this is expected behavior for the go command running in modules mode. The go command documentation for module downloading and verification describes this - namely that it creates a go.mod and go.sum in the main module's root directory, and will be updated/created when a new dependency is installed. I don't think it has anything to do with being in a git repository specifically, but being in a directory that contains go code.
This also may be a more appropriate question to post at https://golang.org/wiki/Questions.
/cc @bcmills to correct me or add extra context.