analysisutil

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package analysisutil defines various helper functions used by two or more packages beneath go/analysis.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(fset *token.FileSet, x ast.Expr) string

Format returns a string representation of the expression.

func HasSideEffects

func HasSideEffects(info *types.Info, e ast.Expr) bool

HasSideEffects reports whether evaluation of e has side effects.

func Imports

func Imports(pkg *types.Package, path string) bool

Imports returns true if path is imported by pkg.

func LineStart

func LineStart(f *token.File, line int) token.Pos

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

func ReadFile(fset *token.FileSet, filename string) ([]byte, *token.File, error)

ReadFile reads a file and adds it to the FileSet so that we can report errors against it using lineStart.

func Unparen

func Unparen(e ast.Expr) ast.Expr

Unparen returns e with any enclosing parentheses stripped.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL