Documentation ¶
Overview ¶
Package goanalysis provides a toolset for statically analysing Go applications
Index ¶
- Variables
- func DiscoverMain(path string) (pkgPaths []string, err error)
- func DiscoverOneMain(path string) (pkgPath string, err error)
- func FormatImports(f *ast.File) map[string]string
- func FuncVarExists(f *ast.File, goImport, methodSignature string) bool
- func UpdateInitImports(file *ast.File, writer io.Writer, importsToAdd, importsToRemove []string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMultipleMainPackagesFound = errors.New("multiple main packages found")
ErrMultipleMainPackagesFound is returned when multiple main packages found while expecting only one.
Functions ¶
func DiscoverMain ¶
DiscoverMain finds main Go packages under path.
func DiscoverOneMain ¶
DiscoverOneMain tries to find only one main Go package under path.
func FormatImports ¶ added in v0.25.0
FormatImports translate f.Imports into a map where name -> package. Name is the alias if declared, or the last element of the package path.
func FuncVarExists ¶ added in v0.27.0
FuncVarExists finds a genesis variable goImport into the go file.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.