package analysisutil
import "golang.org/x/tools/go/analysis/passes/internal/analysisutil"
Package analysisutil defines various helper functions used by two or more packages beneath go/analysis.
Index ¶
- 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 LineStart(f *token.File, line int) token.Pos
- func ReadFile(fset *token.FileSet, filename string) ([]byte, *token.File, error)
- func Unparen(e ast.Expr) ast.Expr
Functions ¶
func Format ¶
Format returns a string representation of the expression.
func HasSideEffects ¶
HasSideEffects reports whether evaluation of e has side effects.
func Imports ¶
Imports returns true if path is imported by pkg.
func LineStart ¶
LineStart returns the position of the start of the specified line within file f, or NoPos if there is no line of that number.
func ReadFile ¶
ReadFile reads a file and adds it to the FileSet so that we can report errors against it using lineStart.
func Unparen ¶
Unparen returns e with any enclosing parentheses stripped.
Source Files ¶
util.go
- Version
- v0.3.0
- Published
- Nov 9, 2022
- Platform
- js/wasm
- Imports
- 6 packages
- Last checked
- 7 hours ago –
Tools for package owners.