Documentation
¶
Overview ¶
Package diff diff块
Package diff 常量 ¶
Package diff 处理go语言git diff解析 `git diff source target`
Package diff 输入数据源 ¶
Package diff 图例 ¶
Package diff diff行 ¶
Package diff 元数据
Index ¶
Constants ¶
View Source
const ( MarkDelete = "---" // 源文件图例 MarkInsert = "+++" // 目标文件图例 )
View Source
const (
ChunkPrefix = "@@" // diff块前缀
)
View Source
const (
InputPrefix = "diff --git " // diff输入前缀
)
View Source
const (
MetaIndex = "index" // 索引
)
View Source
const (
Space = " " // 空格
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Chunk ¶
type Chunk struct { Header string // 块头部 SourceRange *Range // 源文件行范围 TargetRange *Range // 目标文件行范围 }
Chunk diff块
type File ¶
type File struct { Mode FileMode `json:"mode,omitempty"` // 文件变动模式 Input *Input `json:"input,omitempty"` // diff输入 Metas []*Meta `json:"metas,omitempty"` // diff元数据 Legends []*Legend `json:"legends,omitempty"` // diff图例 Chunks []*Chunk `json:"chunks,omitempty"` // diff块 }
File 文件
type Input ¶
type Input struct { Source string `json:"source,omitempty"` // 源文件 Target string `json:"target,omitempty"` // 目标文件 }
Input diff输入
type Legend ¶
type Legend struct { Mark string `json:"mark,omitempty"` Content string `json:"content,omitempty"` }
Legend diff图例
type Line ¶
type Line struct { Mode LineMode `json:"mode,omitempty"` // 行变动类型 Number int32 `json:"number,omitempty"` // 行号 }
Line diff行
Click to show internal directories.
Click to hide internal directories.