Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseVersion ¶
ParseVersion retrieves a reference out of a version.
func SanitizeDependency ¶
func StripVersionFromDependency ¶
StripVersionFromDependency removes the version that might exist as the last fields in the `require` path for such dependency.
For instance, having in `go.mod`:
require github.com/my/mod/v2 v2.0.0
This method would take:
github.com/my/mod/v2
And return
github.com/my/mod
If the last piece is a proper semver version, erroring otherwise.
Types ¶
type Line ¶
Line represents the contents of a line without any parsing applied to the fields beside filtering out unwanted content.
func ParseLine ¶
ParseLine parses a single dependency line, returning the struct that represents its contents, with the version already interpreted as a reference.
gopkg.in/gorethink/gorethink.v4 v4.1.0+incompatible // indirect | | | | | | | | *-+---------------------------* *-+--* *+--------* *-----+---* | | | | | | excluded from parsing | | | reference (e.g., git tag) | dependency name (where to ask for go source code)
In case of a replace directive being used, only the target is taken into considration.