unsafeptr

Imports

Imports #

_ "embed"
"go/ast"
"go/token"
"go/types"
"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"

Constants & Variables

Analyzer var #

var Analyzer = *ast.UnaryExpr

doc var #

go:embed doc.go

var doc string

Functions

hasBasicType function #

hasBasicType reports whether x's type is a types.Basic with the given kind.

func hasBasicType(info *types.Info, x ast.Expr, kind types.BasicKind) bool

isReflectHeader function #

isReflectHeader reports whether t is reflect.SliceHeader or reflect.StringHeader.

func isReflectHeader(t types.Type) bool

isSafeArith function #

isSafeArith reports whether x is a pointer arithmetic expression that is safe to convert to unsafe.Pointer.

func isSafeArith(info *types.Info, x ast.Expr) bool

isSafeUintptr function #

isSafeUintptr reports whether x - already known to be a uintptr - is safe to convert to unsafe.Pointer.

func isSafeUintptr(info *types.Info, x ast.Expr) bool

run function #

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

Generated with Arrow