HiveBrain v1.2.0
Get Started
← Back to all entries
patterngoCritical

Should go.sum file be checked in to the git repository?

Submitted by: @import:stackoverflow-api··
0
Viewed 0 times
shouldthesumcheckedfilegitrepository

Problem

I have a program with source code hosted on GitHub that uses Go Modules introduced in go 1.11.

go.mod file describes my dependencies, but go.sum file seems to be a lockfile. Should I be adding go.sum to my repository or should I gitignore it?

Solution

https://go.dev/wiki/Modules#should-i-commit-my-gosum-file-as-well-as-my-gomod-file

Typically your module’s go.sum file should be committed along with your go.mod file.

Context

Stack Overflow Q#53837919, score: 197

Revisions (0)

No revisions yet.