go.sum viewer
Drop a go.sum to see which module versions it holds checksums for, each linked to pkg.go.dev. Your browser opens it on your device: nothing is uploaded.
What you see
| go.sum in the viewer | What it does |
|---|---|
| Lines read | A module path, a version and an h1: checksum; /go.mod lines counted apart |
| h1: | A SHA-256 hash of the module’s files, in base64 |
| Not done | Checksums are shown, not checked: that needs the module’s own files |
| Problems | Lines that are not checksum lines, with their line |
| Name | Known as go.sum, or by its lines when renamed |
| Extensions | .gosum, .sum |
| Upload | None: opened on your device |
What is a go.sum file?
go.sum sits beside go.mod in a Go module and holds a checksum for each module version the go command has downloaded: one for the version’s files and one for its go.mod file. Every later download is checked against it, so a module that changed after it was first fetched is refused.
How to open a go.sum file
- Add your go.sum. Drop the file in the box, choose it or paste it.
- Look at it. How many modules and versions it holds, how many have a checksum of their code and how many only of their go.mod file, every version as a list with its page on pkg.go.dev, and any line that is not a checksum line. The file shows with line numbers.
Questions
Should go.sum be committed to Git?
Yes, together with go.mod. Then everyone who builds the module checks downloads against the same checksums.
Why does go.sum list versions that go.mod doesn’t?
While it picks versions, the go command reads the go.mod files of other versions and records a checksum for each one. go.mod alone says which versions are used; go mod tidy removes lines that are no longer needed.
What does “checksum mismatch” mean?
A download did not match its line in go.sum: the module changed after it was first recorded, or the line is wrong. The go command stops with SECURITY ERROR instead of building with it.
Where do the checksums come from?
The first time the go command downloads a module version, it checks it against Go’s public checksum database, sum.golang.org, unless GOPRIVATE or GONOSUMDB leave the module out, and then writes it to go.sum.
Is my file uploaded?
No. The viewer runs in your browser and opens the file on your device. Nothing is sent anywhere.
Can opening a file here damage it?
No. The viewer only reads the file: a browser gives a page no way to change it. If something goes wrong, the view stops and the file is as it was.