compare

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func YAMLCmp

func YAMLCmp(a, b string) string

YAMLCmp compares two yaml texts, return a tree based diff text.

func YAMLCmpWithIgnore

func YAMLCmpWithIgnore(a, b string, ignorePaths []string) string

YAMLCmpWithIgnore compares two yaml texts, and ignores paths in ignorePaths.

Types

type YAMLCmpReporter

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

YAMLCmpReporter is a custom reporter to generate tree based diff for YAMLs, used by cmp.Equal().

func (*YAMLCmpReporter) PopStep

func (r *YAMLCmpReporter) PopStep()

PopStep implements interface to keep track of current path by popping a step out. of YAMLCmpReporter.path

func (*YAMLCmpReporter) PushStep

func (r *YAMLCmpReporter) PushStep(ps cmp.PathStep)

PushStep implements interface to keep track of current path by pushing. a step into YAMLCmpReporter.path

func (*YAMLCmpReporter) Report

func (r *YAMLCmpReporter) Report(rs cmp.Result)

Report implements interface to add diff path into YAMLCmpReporter.diffTree.

func (*YAMLCmpReporter) String

func (r *YAMLCmpReporter) String() string

String returns a text representation of diff tree.

Jump to

Keyboard shortcuts

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