packages.go 1.1 KB

123456789101112131415161718192021222324252627282930
  1. // Copyright 2020 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Package packagesinternal exposes internal-only fields from go/packages.
  5. package packagesinternal
  6. import (
  7. "golang.org/x/tools/internal/gocommand"
  8. )
  9. var GetForTest = func(p interface{}) string { return "" }
  10. var GetDepsErrors = func(p interface{}) []*PackageError { return nil }
  11. type PackageError struct {
  12. ImportStack []string // shortest path from package named on command line to this one
  13. Pos string // position of error (if present, file:line:col)
  14. Err string // the error itself
  15. }
  16. var GetGoCmdRunner = func(config interface{}) *gocommand.Runner { return nil }
  17. var SetGoCmdRunner = func(config interface{}, runner *gocommand.Runner) {}
  18. var TypecheckCgo int
  19. var DepsErrors int // must be set as a LoadMode to call GetDepsErrors
  20. var ForTest int // must be set as a LoadMode to call GetForTest
  21. var SetModFlag = func(config interface{}, value string) {}
  22. var SetModFile = func(config interface{}, value string) {}