Documentation ¶
Overview ¶
Package analysisutil defines various helper functions used by two or more packages beneath go/analysis.
Index ¶
- Variables
- func Format(fset *token.FileSet, x ast.Expr) string
- func HasSideEffects(info *types.Info, e ast.Expr) bool
- func Imports(pkg *types.Package, path string) bool
- func IsFunctionNamed(f *types.Func, pkgPath string, names ...string) bool
- func IsNamedType(t types.Type, pkgPath string, names ...string) bool
- func LineStart(f *token.File, line int) token.Pos
- func ReadFile(pass *analysis.Pass, filename string) ([]byte, *token.File, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var MustExtractDoc = analysisinternal.MustExtractDoc
Functions ¶
func HasSideEffects ¶
HasSideEffects reports whether evaluation of e has side effects.
func IsFunctionNamed ¶ added in v0.15.0
IsFunctionNamed reports whether f is a top-level function defined in the given package and has one of the given names. It returns false if f is nil or a method.
func IsNamedType ¶ added in v0.15.0
IsNamedType reports whether t is the named type with the given package path and one of the given names. This function avoids allocating the concatenation of "pkg.Name", which is important for the performance of syntax matching.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.