Documentation ¶
Overview ¶
Package mingo contains logic for scanning the packages in a Go module to determine the lowest-numbered version of Go that can build it.
Index ¶
Constants ¶
const Mode = packages.NeedName | packages.NeedFiles | packages.NeedSyntax | packages.NeedTypes | packages.NeedTypesInfo | packages.NeedModule
Mode is the minimum mode needed when using packages.Load to scan packages.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Result ¶
type Result interface { Version() int // The lowest minor version of Go 1.x required. String() string // A descriptive string explaining the result. }
Result is the type of a result returned by Scanner.ScanDir and Scanner.ScanPackages.
type Scanner ¶
type Scanner struct { Deps bool // include dependencies Indirect bool // with Deps, include indirect dependencies Verbose bool // be verbose Tests bool // scan *_test.go files Check bool // produce an error if the module declares the wrong version in go.mod HistDir string // find Go stdlib history in this directory (default: $GOROOT/api) Result Result // contains filtered or unexported fields }
Scanner scans a directory or set of packages to determine the lowest-numbered version of Go 1.x that can build them.
func (*Scanner) Analyzer ¶ added in v0.5.0
Analyzer produces an analysis.Analyzer that can be used to scan packages. The result (which may depend on scanning multiple packages) is available in s.Result.
func (*Scanner) ScanDir ¶
ScanDir scans the module in a directory to determine the lowest-numbered version of Go 1.x that can build it.
func (*Scanner) ScanPackages ¶
ScanPackages scans the given packages to determine the lowest-numbered version of Go 1.x that can build them. The packages must all be in the same module. When using packages.Load to load the packages, the value for packages.Config.Mode must be at least Mode.
type VersionError ¶
VersionError is the error returned by Scanner.ScanDir or Scanner.ScanPackages when [Scanner.Check] is enabled.
func (VersionError) Error ¶
func (e VersionError) Error() string