astdiff

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnalysisResult

type AnalysisResult struct {
	Changes []Change
	Objects map[string]struct {
		Type     string
		Package  string
		Position token.Position
		Node     ast.Node
	}
}

func LoadDiff

func LoadDiff(oldPkgs, newPkgs []*packages.Package) (*AnalysisResult, error)

type Change

type Change struct {
	Type       ChangeType // "added", "removed", "modified"
	Package    string
	Object     string // 函数名、变量名等
	ObjectType string // "func", "var", "const", "type"
	ObjectID   string // 对象的唯一标识符
	File       string // 文件名
}

type ChangeType

type ChangeType string
const (
	ChangeTypeAdded    ChangeType = "added"    // 新增
	ChangeTypeRemoved  ChangeType = "removed"  // 移除
	ChangeTypeModified ChangeType = "modified" // 修改
)

Jump to

Keyboard shortcuts

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