shift

Imports

Imports #

"go/ast"
"go/constant"
"go/types"
"go/ast"
"go/constant"
"go/token"
"go/types"
"math"
"golang.org/x/tools/go/analysis"
"golang.org/x/tools/go/analysis/passes/inspect"
"golang.org/x/tools/go/analysis/passes/internal/analysisutil"
"golang.org/x/tools/go/ast/inspector"
"golang.org/x/tools/internal/typeparams"

Constants & Variables

Analyzer var #

var Analyzer = *ast.UnaryExpr

Doc const #

const Doc = "check for shifts that equal or exceed the width of the integer"

Functions

checkLongShift function #

checkLongShift checks if shift or shift-assign operations shift by more than the length of the underlying variable.

func checkLongShift(pass *analysis.Pass, node ast.Node, x ast.Expr, y ast.Expr)

run function #

func run(pass *analysis.Pass) (interface{}, error)

updateDead function #

updateDead puts unreachable "if" and "case" nodes into dead.

func updateDead(info *types.Info, dead map[ast.Node]bool, node ast.Node)

Generated with Arrow