Skip to content

Commit

Permalink
cmd/go: respect -mod=readonly when performing 'mod verify'
Browse files Browse the repository at this point in the history
Fixes #31372
  • Loading branch information
haosdent committed Apr 28, 2019
1 parent 049c8db commit 6e33b78
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cmd/go/internal/modfetch/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,10 @@ func Sum(mod module.Version) string {

// WriteGoSum writes the go.sum file if it needs to be updated.
func WriteGoSum() {
if cfg.BuildMod == "readonly" {
base.Fatalf("go: updates to go.sum needed, disabled by -mod=readonly")
}

goSum.mu.Lock()
defer goSum.mu.Unlock()

Expand Down

0 comments on commit 6e33b78

Please sign in to comment.