go/src/cmd/api/main_test.go

const verbose

func goCmd() string {}

var contexts

func contextName(c *build.Context) string {}

var internalPkg

var exitCode

func Check(t *testing.T) {}

// export emits the exported package features.
func (w *Walker) export(pkg *apiPackage) {}

func set(items []string) map[string]bool {}

var spaceParensRx

func featureWithoutContext(f string) string {}

// portRemoved reports whether the given port-specific API feature is
// okay to no longer exist because its port was removed.
func portRemoved(feature string) bool {}

func compareAPI(w io.Writer, features, required, exception []string) (ok bool) {}

var aliasReplacer

func fileFeatures(filename string, needApproval bool) []string {}

var fset

type Walker

func NewWalker(context *build.Context, root string) *Walker {}

func (w *Walker) Features() (fs []string) {}

var parsedFileCache

func (w *Walker) parseFile(dir, file string) (*ast.File, error) {}

const usePkgCache

var pkgCache

var pkgTags

// tagKey returns the tag-based key to use in the pkgCache.
// It is a comma-separated string; the first part is dir, the rest tags.
// The satisfied tags are derived from context but only those that
// matter (the ones listed in the tags argument plus GOOS and GOARCH) are used.
// The tags list, which came from go/build's Package.AllTags,
// is known to be sorted.
func tagKey(dir string, context *build.Context, tags []string) string {}

type listImports

var listCache

var listSem

type semToken

// loadImports populates w with information about the packages in the standard
// library and the packages they themselves import in w's build context.
//
// The source import path and expanded import path are identical except for vendored packages.
// For example, on return:
//
//	w.importMap["math"] = "math"
//	w.importDir["math"] = "<goroot>/src/math"
//
//	w.importMap["golang.org/x/net/route"] = "vendor/golang.org/x/net/route"
//	w.importDir["vendor/golang.org/x/net/route"] = "<goroot>/src/vendor/golang.org/x/net/route"
//
// Since the set of packages that exist depends on context, the result of
// loadImports also depends on context. However, to improve test running time
// the configuration for each environment is cached across runs.
func (w *Walker) loadImports() {}

// listEnv returns the process environment to use when invoking 'go list' for
// the given context.
func listEnv(c *build.Context) []string {}

type apiPackage

var importing

// Import implements types.Importer.
func (w *Walker) Import(name string) (*types.Package, error) {}

// ImportFrom implements types.ImporterFrom.
func (w *Walker) ImportFrom(fromPath, fromDir string, mode types.ImportMode) (*types.Package, error) {}

func (w *Walker) import_(name string) (*apiPackage, error) {}

func (w *Walker) importFrom(fromPath, fromDir string, mode types.ImportMode) (*apiPackage, error) {}

// pushScope enters a new scope (walking a package, type, node, etc)
// and returns a function that will leave the scope (with sanity checking
// for mismatched pushes & pops)
func (w *Walker) pushScope(name string) (popFunc func()) {}

func sortedMethodNames(typ *types.Interface) []string {}

// sortedEmbeddeds returns constraint types embedded in an
// interface. It does not include embedded interface types or methods.
func (w *Walker) sortedEmbeddeds(typ *types.Interface) []string {}

func (w *Walker) writeType(buf *bytes.Buffer, typ types.Type) {}

func (w *Walker) writeSignature(buf *bytes.Buffer, sig *types.Signature) {}

func (w *Walker) writeTypeParams(buf *bytes.Buffer, tparams *types.TypeParamList, withConstraints bool) {}

func (w *Walker) writeParams(buf *bytes.Buffer, t *types.Tuple, variadic bool) {}

func (w *Walker) typeString(typ types.Type) string {}

func (w *Walker) signatureString(sig *types.Signature) string {}

func (w *Walker) emitObj(obj types.Object) {}

func (w *Walker) emitType(obj *types.TypeName) {}

func (w *Walker) emitStructType(name string, typ *types.Struct) {}

func (w *Walker) emitIfaceType(name string, typ *types.Interface) {}

func (w *Walker) emitFunc(f *types.Func) {}

func (w *Walker) emitMethod(m *types.Selection) {}

func (w *Walker) emitf(format string, args ...any) {}

func needApproval(filename string) bool {}

func (w *Walker) collectDeprecated() {}

func (w *Walker) isDeprecated(obj types.Object) bool {}