Skip to content
New issue

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? Sign in to your account

cmd/go: go build -mod=readonly should disallow go.sum updates #30667

rsc opened this issue Mar 8, 2019 · 2 comments


Copy link

commented Mar 8, 2019

go build -mod=readonly disallows go.mod updates.
It should also disallow go.sum updates.
Maybe it already does; I haven't checked.


This comment has been minimized.

Copy link

commented Mar 8, 2019

can confirm that -mod=readonly does not disallow go.sum updates.

go mod init reproduce 
go get
echo "" > go.sum
go build -mod=readonly

This comment has been minimized.

Copy link

commented Mar 8, 2019

Change mentions this issue: cmd/go: disallow go.sum updates in -mod=readonly

@bcmills bcmills added the NeedsFix label Mar 28, 2019

@gopherbot gopherbot closed this in d21c7b7 May 8, 2019

@thepudds thepudds added the modules label May 14, 2019

anoadragon453 added a commit to matrix-org/dendrite that referenced this issue Jul 12, 2019

Backup and restore go.mod & go.sum during linting (#735)
Every time before sending a PR I like to run ./scripts/ to make sure the CI won't complain about anything.

The problem is that this script attempts to install golangci-lint, which causes modifications to go.mod/go.sum. This PR backs up and restores those files before and after linting.

Ideally instead of this hacky backing up/restoring we'd use go gets -mod=readonly option, but that still modifies go.sum. This will be fixed in go 1.13 apparently. golang/go#30667
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
5 participants
You can’t perform that action at this time.