refactor

package
v0.3.5-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssignUnhandledErrors

func AssignUnhandledErrors(packages []*decorator.Package)

AssignUnhandledErrors transforms the program by refactoring calls to functions that return errors to assignments to fresh variables that contain errors

func InsertNilChecks

func InsertNilChecks(packages []*decorator.Package)

InsertNilChecks inserts nil checks in all functions that contains @nonnil as comment for a parameter. If any error is encountered, then the function will be left as is.

func ReturnsError

func ReturnsError(signature types.Object) (*types.Tuple, bool)

ReturnsError returns a pair of a tuple of types and a boolean such that the boolean is true whenever the signature is the signature of a function returning some error.

func WithScope

func WithScope(packages []*decorator.Package, post transform)

WithScope applies the transform post to packages as a post operation in Apply. It first runs the function that builds information necessary to have access to closest scopes within a function. The post transform can use the FuncInfo's various scope operations

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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