Today I Learned
Anatomy of `go.mod` file
Posted on 20 Aug, 2021
Consider a hypothetical go.mod file
module hello
go 1.13
require ( v0.3.0 // indirect v1.5.2 version v0.0.0-20170915032832-14c0d48ead0c
The version v0.0.0-20170915032832-14c0d48ead0c is an example of a pseudo-version, which is the go command’s version syntax for a specific untagged commit. The format looks like this,
Most recent tagged version + Commit time UTC + Commit prefix (12 chars)
The indirect comment indicates a dependency is not used directly by this module, only indirectly by other module dependencies (transitive dependency).
Copy link
Edit on GitHub