Negate Golang 1.16 go mod download affecting go.sum #382
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Golang 1.16 RC 1 has a behavior change where
go mod download
affects the go.sum file adding additional listed modules. These additional modules in go.sum are removed with ago mod tidy
. @howardjohn wrote golang/go#43994 for the change in behavior which was closed as working as designed.Two Istio PRs were already merged to change the order of targets so that the
go mod tidy
happened after thego mod download
during amake gen
so the go.sum file doesn't highlight a change. This PR is adding ago mod tidy
within the makefile target containing thego mod download
so the target itself won't have an overall effect on go.sum.Some testing shows that
go mod download
places about 1.55 GB of modules into the cache. In John's PR they mentioned usinggo list
instead ofgo mod download
as the number of modules downloaded will be less and go.sum will not be affected.go list
downloads about 750 MB worth of files.The
go mod download
was added into the makefiles when the license-lint related targets were added. It was a precursor to the license-lint call. The license-lint code actually does ago list -mod=readonly -deps -test ./...
so doing thego mod download
is not actually needed.I did add an extra target which downloads the files using
go list
, just to highlight an alternative command/target. It is possible to remove the lines between the mod-download-go and list-all-go targets so both just do thego list
.@jwendell, I know you made some changes in this space, so would like your feedback as well.