Notes & TILs
Search…
Anatomy of `go.mod` file
Posted on 20 Aug, 2021
Consider a hypothetical go.mod file
1
module hello
2
​
3
go 1.13
4
​
5
require (
6
golang.org/x/demo v0.3.0 // indirect
7
rsc.io/quote v1.5.2
8
golang.org/x/text version v0.0.0-20170915032832-14c0d48ead0c
9
)
Copied!
The golang.org/x/text 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,
vX.Y.Z-yyyymmddhhmmss-abcdefxyz
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).
Last modified 1mo ago
Copy link