Skip to main content

Module lockfile

Module lockfile 

Source
Expand description

go.sum lock file parsing.

Parses go.sum files to extract resolved dependency versions. go.sum contains checksums for all modules used in a build, including transitive dependencies and multiple versions.

§go.sum Format

Each line in go.sum has the format:

module_path version hash

Example:

github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg=
github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL9t9/HBtKc7e/Q7Nb2nqKqTW8mHZy6E7k8m4dLvs=
golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrq...
golang.org/x/sync v0.5.0/go.mod h1:RxMgew5V...

§Line Types

  • Lines ending with /go.mod are module file checksums (skipped for version resolution)
  • Lines with h1:hash are actual module content checksums (used for version resolution)
  • A module may appear multiple times with different versions

Structs§

GoSumParser
go.sum file parser.

Functions§

parse_go_sum
Parses go.sum content and returns resolved packages.