tools: Index | Files

package analysisinternal

import ""

Package analysisinternal exposes internal-only fields from go/analysis.


Package Files



var (
    GetTypeErrors func(p interface{}) []types.Error
    SetTypeErrors func(p interface{}, errors []types.Error)

func StmtToInsertVarBefore Uses

func StmtToInsertVarBefore(path []ast.Node) ast.Stmt

StmtToInsertVarBefore returns the ast.Stmt before which we can safely insert a new variable. Some examples:

Basic Example: z := 1 y := z + x If x is undeclared, then this function would return `y := z + x`, so that we can insert `x := ` on the line before `y := z + x`.

If stmt example: if z == 1 { } else if z == y {} If y is undeclared, then this function would return `if z == 1 {`, because we cannot insert a statement between an if and an else if statement. As a result, we need to find the top of the if chain to insert `y := ` before.

func TypeErrorEndPos Uses

func TypeErrorEndPos(fset *token.FileSet, src []byte, start token.Pos) token.Pos

func TypeExpr Uses

func TypeExpr(fset *token.FileSet, f *ast.File, pkg *types.Package, typ types.Type) ast.Expr

func WalkASTWithParent Uses

func WalkASTWithParent(n ast.Node, f func(n ast.Node, parent ast.Node) bool)

WalkASTWithParent walks the AST rooted at n. The semantics are similar to ast.Inspect except it does not call f(nil).

func ZeroValue Uses

func ZeroValue(fset *token.FileSet, f *ast.File, pkg *types.Package, typ types.Type) ast.Expr

type TypeErrorPass Uses

type TypeErrorPass string
const (
    NoNewVars      TypeErrorPass = "nonewvars"
    NoResultValues TypeErrorPass = "noresultvalues"
    UndeclaredName TypeErrorPass = "undeclaredname"

Package analysisinternal imports 7 packages (graph) and is imported by 13 packages. Updated 2020-08-04. Refresh now. Tools for package owners.