trustedfunc

package
v0.0.0-...-c91e71c Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package trustedfunc implements a trusted function framework where it hooks into different parts of NilAway to provide additional context for certain function calls. This is useful for well-known standard or 3rd party libraries where we can encode certain knowledge about them ( e.g., `assert.Nil(t, x)` implies `x == nil`) and use that to provide better analysis.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func As

func As(expr ast.Expr, p *analysis.Pass) (any, bool)

As checks a function call AST node to see if it is one of the trusted functions, and if it is then runs the corresponding action and returns that as the output along with a bool indicating success or failure. For example, a binary expression `x != nil` is returned for trusted function `assert.NotNil(t, x)`, while a `TrustedFuncNonnil` producer is returned for `errors.New(s)`

Types

This section is empty.

Jump to

Keyboard shortcuts

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