What Is the go.sum File and Why You Should Commit It

The go.sum file stores dependency checksums to ensure build reproducibility and security, so you must commit it to your repository.

The go.sum file is a checksum database that verifies the integrity of your module dependencies and prevents supply chain attacks. You must commit it to version control so that every developer and CI system builds your project with the exact same dependency versions and content.

go mod tidy
git add go.sum
git commit -m "update dependencies"