patcher

package
v1.18.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 7 Imported by: 4 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OperatorOverloading added in v1.16.1

type OperatorOverloading struct {
	Operator  string              // Operator token to overload.
	Overloads []string            // List of function names to replace operator with.
	Env       *nature.Nature      // Env type.
	Functions conf.FunctionsTable // Env functions.

	NtCache *nature.Cache
	// contains filtered or unexported fields
}

func (*OperatorOverloading) Check added in v1.16.1

func (p *OperatorOverloading) Check()

func (*OperatorOverloading) FindSuitableOperatorOverload added in v1.16.1

func (p *OperatorOverloading) FindSuitableOperatorOverload(l, r reflect.Type) (reflect.Type, string, bool)

func (*OperatorOverloading) Reset added in v1.17.0

func (p *OperatorOverloading) Reset()

Tracking must be reset before every walk over the AST tree

func (*OperatorOverloading) ShouldRepeat added in v1.16.1

func (p *OperatorOverloading) ShouldRepeat() bool

func (*OperatorOverloading) Visit added in v1.16.1

func (p *OperatorOverloading) Visit(node *ast.Node)

type WithContext

type WithContext struct {
	Name      string
	Functions conf.FunctionsTable // Optional: used to look up function types when callee type is unknown.
	Env       *nature.Nature      // Optional: used to look up method types when callee type is unknown.
	NtCache   *nature.Cache       // Optional: cache for nature lookups.
}

WithContext adds WithContext.Name argument to all functions calls with a context.Context argument.

func (WithContext) Visit

func (w WithContext) Visit(node *ast.Node)

Visit adds WithContext.Name argument to all functions calls with a context.Context argument.

type WithTimezone added in v1.16.6

type WithTimezone struct {
	Location *time.Location
}

WithTimezone passes Location to date() and now() functions.

func (WithTimezone) Visit added in v1.16.6

func (t WithTimezone) Visit(node *ast.Node)

Directories

Path Synopsis
Package value provides a Patcher that uses interfaces to allow custom types that can be represented as standard go values to be used more easily in expressions.
Package value provides a Patcher that uses interfaces to allow custom types that can be represented as standard go values to be used more easily in expressions.

Jump to

Keyboard shortcuts

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