Photo by Emile Perron on Unsplash
Details you might NOT know about go.mod & go.sum
It's Go's official tool for package/dependency management.
Table of contents
No headings in the article.
Go Modules came out on version 1.12
It's Go's official tool for package/dependency management.
Go Modules mainly use two files to keep track of the dependencies. go.mod & go.sum
And here's what they do:
1. go.mod
Initializes the project module & records the module path
Records the version of Go in use
Records the direct dependencies
User-defined
2. go.sum
Lists the checksum of direct and indirect dependencies
Records the version of said dependencies
Auto-generated & un-editable
Small note: checksums are used to confirm that dependencies haven't been modified since last pulled.
Go Modules is one of the most fundamental tools for when programming in Go.
Make great use of it!