checks

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckClosedChannel

func CheckClosedChannel(r *report.Reporter, info *types.Info, st *state.StateTracker, node ast.Node)

CheckClosedChannel detects sending on or closing an already closed channel.

func CheckDivisionByZero

func CheckDivisionByZero(r *report.Reporter, info *types.Info, node ast.Node)

CheckDivisionByZero detects integer division or modulo by a literal zero.

func CheckExplicitPanic

func CheckExplicitPanic(r *report.Reporter, info *types.Info, node ast.Node)

CheckExplicitPanic flags direct calls to the built-in panic function.

func CheckNilChannelOps

func CheckNilChannelOps(r *report.Reporter, info *types.Info, st *state.StateTracker, node ast.Node)

CheckNilChannelOps detects sends to or closing of a nil channel.

func CheckNilDereference

func CheckNilDereference(r *report.Reporter, info *types.Info, st *state.StateTracker, node ast.Node)

CheckNilDereference detects `*p` where `p` could be nil.

func CheckNilFuncCall

func CheckNilFuncCall(r *report.Reporter, info *types.Info, st *state.StateTracker, node ast.Node)

CheckNilFuncCall detects calls to function variables that could be nil.

func CheckNilMapWrite

func CheckNilMapWrite(r *report.Reporter, info *types.Info, st *state.StateTracker, node ast.Node)

CheckNilMapWrite detects writes to a map that could be nil.

func CheckOutOfBounds

func CheckOutOfBounds(r *report.Reporter, info *types.Info, node ast.Node)

CheckOutOfBounds detects index or slice bounds errors on arrays with a known size.

func CheckTypeAssertion

func CheckTypeAssertion(r *report.Reporter, c *astutil.Cursor)

CheckTypeAssertion finds single-value type assertions that are not protected. It requires the AST cursor to check the parent node.

func IsBuiltin

func IsBuiltin(info *types.Info, ident *ast.Ident) bool

IsBuiltin checks if an identifier refers to a built-in function like panic or close. It correctly returns a boolean value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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