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

config

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDiffFound = errors.New("DiffFound")
View Source
var ErrNoDiffCommand = errors.New("NoDiffCommand")

Functions

This section is empty.

Types

type Config

type Config struct {
	Context              int       `name:"context" short:"C" default:"3" usage:"diff context"`
	Separator            string    `name:"separator" short:"d" default:">" usage:"object id separator"`
	Indent               int       `name:"indent" short:"n" default:"2" usage:"yaml indent"`
	Out                  string    `name:"out" short:"o" default:"text" usage:"output format: text,yaml,id,idlist,markdown"`
	Debug                bool      `name:"debug" usage:"enable debug log"`
	Quiet                bool      `name:"quiet" short:"q" usage:"quiet log"`
	Color                bool      `name:"color" short:"c" usage:"colored diff"`
	DiffSuccess          bool      `name:"success" usage:"exit with 0 even if inputs differ"`
	AllowDuplicateKey    bool      `name:"allow-duplicate-key" default:"true" usage:"allow the use of keys with the same name in the same map"`
	DiffCommand          string    `name:"diff-cmd" short:"x" usage:"invoke this to get diff instead of builtin differ"`
	Verbose              bool      `name:"verbose" short:"v" usage:"enable verbose output; annotate diff type and display summary"`
	Labels               []string  `name:"label" short:"L" usage:"use label instead of file name"`
	MarkdownHeadingLevel uint      `name:"markdown-heading" default:"1" usage:"highest heading level in markdown"`
	Stdin                io.Reader `name:"-"`
	IgnoreMatchingLines  []string  `name:"ignore-matching-lines" short:"I" usage:"ignore lines matching regexp (may be specified multiple times)"`
	IgnoreFields         []string  `name:"ignore-field" short:"F" usage:"ignore field by path or yq expression (may be specified multiple times)"`
	IgnoreLabels         []string  `name:"ignore-label" usage:"ignore label by key (may be specified multiple times)"`
	IgnoreAnnotations    []string  `name:"ignore-annotation" usage:"ignore annotation by key (may be specified multiple times)"`
	IgnoreManagedFields  bool      `name:"ignore-managed-fields" usage:"ignore metadata.managedFields"`
	IgnoreStatus         bool      `name:"ignore-status" usage:"ignore status field"`
}

func (*Config) OutMode

func (c *Config) OutMode() OutMode

func (*Config) Run

func (c *Config) Run(w io.Writer, left, right string) error

type OutMode

type OutMode string
const (
	OutModeUnknown  OutMode = "unknown"
	OutModeText     OutMode = "text"
	OutModeYaml     OutMode = "yaml"
	OutModeID       OutMode = "id"
	OutModeIDList   OutMode = "idlist"
	OutModeMarkdown OutMode = "markdown"
)

Jump to

Keyboard shortcuts

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