Should I Commit the go.sum File to the Repo?
TL;DR Yes, probably. Using Go Modules, you will have both a go.mod and a go.sum file within your coding repository. A question often asked is whether you should commit the sum portion of the file as it’s automatically generated. These files help manage the dependencies of your project and they differ by the go.mod file being human-friendly, listing the libraries used within the project, and the go.sum listing the very specific vendor versions of each dependency (not just your direct ones, but also the whole tree).
Update All Go Packages in Your Project
If you want to update all dependencies and packages within your project then the simplest way is to use the go get command which handles it all for us. Go modules (go mod) will handle most of the versioning of these packages, so deploying and sharing the project will keep the same package versions.