Help us shape the future of Go! Take the 2026 Go Developer Survey

diff

package
v3.1.6 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const MaxCandidates = 100
View Source
const MaxFunctionBlocks = 5000

Variables

This section is empty.

Functions

func GetHardenedEnv

func GetHardenedEnv() []string

func IsCommutativeOp

func IsCommutativeOp(op token.Token) bool

func MatchFunctionsByTopology

func MatchFunctionsByTopology(oldResults, newResults []FingerprintResult, threshold float64) (
	matched []TopologyMatch,
	addedFuncs []FingerprintResult,
	removedFuncs []FingerprintResult,
)

func ShortFuncName

func ShortFuncName(fullName string) string

Types

type FingerprintResult

type FingerprintResult struct {
	FunctionName string
	Fingerprint  string
	CanonicalIR  string
	Pos          token.Pos
	Line         int
	Filename     string
	// contains filtered or unexported fields
}

func FingerprintPackages

func FingerprintPackages(initialPkgs []*packages.Package, policy ir.LiteralPolicy, strictMode bool) ([]FingerprintResult, error)

func FingerprintSource

func FingerprintSource(filename string, src string, policy ir.LiteralPolicy) ([]FingerprintResult, error)

func FingerprintSourceAdvanced

func FingerprintSourceAdvanced(filename string, src string, policy ir.LiteralPolicy, strictMode bool) ([]FingerprintResult, error)

func GenerateFingerprint

func GenerateFingerprint(fn *ssa.Function, policy ir.LiteralPolicy, strictMode bool) FingerprintResult

func (FingerprintResult) GetSSAFunction

func (r FingerprintResult) GetSSAFunction() *ssa.Function

type TopologyMatch

type TopologyMatch struct {
	OldResult   FingerprintResult
	NewResult   FingerprintResult
	OldTopology *topology.FunctionTopology
	NewTopology *topology.FunctionTopology
	Similarity  float64
	ByName      bool
}

type Zipper

type Zipper struct {
	// contains filtered or unexported fields
}

Zipper implements the semantic delta analysis algorithm.

func NewZipper

func NewZipper(oldFn, newFn *ssa.Function, policy ir.LiteralPolicy) (*Zipper, error)

func (*Zipper) ComputeDiff

func (z *Zipper) ComputeDiff() (*ZipperArtifacts, error)

type ZipperArtifacts

type ZipperArtifacts struct {
	OldFunction  string
	NewFunction  string
	MatchedNodes int
	Added        []string
	Removed      []string
	Preserved    bool
}

ZipperArtifacts contains the results of the semantic delta analysis.

Jump to

Keyboard shortcuts

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