by makeworld · 2y ago · 0 comments
https://central.sonatype.org/publish/requirements/immutabili...
You mean giving it the Go ahead? ;)
https://github.com/apex/up-examples/blob/master/oss/golang-g...
The crates.io approach instead defends you both from a dependency changing silently and from it disappearing from one day to the next, without having to deal with vendoring.
Go does not delete modules from the module proxy except for copyright/legal reasons (I suspect crates.io would delete for these reasons too), and additionally the checksums of all modules are published in a tamper-proof transparency log (https://sum.golang.org/) so if they did alter or delete a module, it would be detected.
I don't know of a single modern build tool that can do this but doesn't require or record this information specifically? Maybe the earlier versions of Go? (I know they've gone through a few changes in module/import strategies.)
Ultimately, if you're doing a code audit, you have to compute the checksum of the code that you're looking at, and compare it against the entry in go.sum or the checksum database to make sure you're auditing the right copy.
[0] https://www.practical-go-lessons.com/chap-18-go-module-proxi...