2020-01-16 12:32:14 -07:00
|
|
|
// Package packagesinternal exposes internal-only fields from go/packages.
|
|
|
|
package packagesinternal
|
|
|
|
|
2020-03-23 06:35:36 -06:00
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"golang.org/x/tools/internal/gocommand"
|
|
|
|
)
|
2020-02-11 08:12:40 -07:00
|
|
|
|
|
|
|
// Fields must match go list;
|
|
|
|
type Module struct {
|
|
|
|
Path string // module path
|
|
|
|
Version string // module version
|
|
|
|
Versions []string // available module versions (with -versions)
|
|
|
|
Replace *Module // replaced by this module
|
|
|
|
Time *time.Time // time version was created
|
|
|
|
Update *Module // available update, if any (with -u)
|
|
|
|
Main bool // is this the main module?
|
|
|
|
Indirect bool // is this module only an indirect dependency of main module?
|
|
|
|
Dir string // directory holding files for this module, if any
|
|
|
|
GoMod string // path to go.mod file used when loading this module, if any
|
|
|
|
GoVersion string // go version used in module
|
|
|
|
Error *ModuleError // error loading module
|
|
|
|
}
|
|
|
|
type ModuleError struct {
|
|
|
|
Err string // the error itself
|
|
|
|
}
|
|
|
|
|
2020-01-16 12:32:14 -07:00
|
|
|
var GetForTest = func(p interface{}) string { return "" }
|
2020-02-11 08:12:40 -07:00
|
|
|
|
|
|
|
var GetModule = func(p interface{}) *Module { return nil }
|
2020-03-23 06:35:36 -06:00
|
|
|
|
|
|
|
var GetGoCmdRunner = func(config interface{}) *gocommand.Runner { return nil }
|
|
|
|
|
|
|
|
var SetGoCmdRunner = func(config interface{}, runner *gocommand.Runner) {}
|