Standard Library

GoBuild

Go stdlib package — go/build. Auto-indexed from CDN. Method-level security roles have not been annotated; rule writers should inspect the source before use.

Other Methods

.ArchChar()Neutral
#
Signature
ArchChar(goarch string) (string, error)

ArchChar returns "?" and an error.

.Context.Import()Neutral
#
Signature
Context.Import(path string, srcDir string, mode ImportMode) (*Package, error)

Import returns details about the Go package named by the import path,

.Context.ImportDir()Neutral
#
Signature
Context.ImportDir(dir string, mode ImportMode) (*Package, error)

ImportDir is like Import but processes the Go package found in

.Context.MatchFile()Neutral
#
Signature
Context.MatchFile(dir string, name string) (bool, error)

MatchFile reports whether the file with the given name in the given directory

.Context.SrcDirs()Neutral
#
Signature
Context.SrcDirs() []string

SrcDirs returns a list of package source root directories.

.Import()Neutral
#
Signature
Import(path string, srcDir string, mode ImportMode) (*Package, error)

Import is shorthand for Default.Import.

.ImportDir()Neutral
#
Signature
ImportDir(dir string, mode ImportMode) (*Package, error)

ImportDir is shorthand for Default.ImportDir.

.IsLocalImport()Neutral
#
Signature
IsLocalImport(path string) bool

IsLocalImport reports whether the import path is

.MultiplePackageError.Error()Neutral
#
Signature
MultiplePackageError.Error() string

MultiplePackageError.Error function.

.NoGoError.Error()Neutral
#
Signature
NoGoError.Error() string

NoGoError.Error function.

Fully-Qualified Names

FQNField
go/buildfqns[0]

Wrong FQN → 0 findings. Verify with: change fqns to garbage → must produce 0 results.

Import

go.mod
// standard library — no go.mod entry required
rule.py
from codepathfinder.go_rule import ...  # go/build