Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrHashMismatch is returned when a hash is added to a go.sum file that does // not match the existing hash. ErrHashMismatch = errors.New("gosum: hash mismatch") // ErrGoSumMustHaveThreeFields is returned when a go.sum file invalidly has // more than 3 fields per line. ErrGoSumMustHaveThreeFields = errors.New( "gosum: go.sum must have 3 fields per line", ) )
Functions ¶
func CompareKeys ¶
CompareKeys compares two GoSumKeys.
Performs lexicographical ordering of module paths, then semver comparison of versions, and finally lexicographical ordering of paths.
Types ¶
type GoSum ¶
GoSum represents a go.sum file.
func Merge ¶
Merge merges two go.sum files together. The current go.sum file is the one that is being modified, the other go.sum file is the one that is being merged in, and the ancestor go.sum file is the common ancestor of the two go.sum files.
If there are inconsistent hashes between the current and other go.sum files, an error is returned.
func (GoSum) String ¶
String returns a string representation of the GoSum map. The format of the string is "<module path> <version> <hash>\n" for each key-value pair in the map. If the key has a non-empty path, it is appended to the version with a "/" separator. The key-value pairs are concatenated in alphabetical order.