MCPcopy
hub / github.com/google/go-cmp / PathStep

Interface PathStep

cmp/path.go:39–59  ·  cmp/path.go::PathStep

PathStep is a union-type for specific operations to traverse a value's tree structure. Users of this package never need to implement these types as values of this type will be returned by this package. Implementations of this interface: - [StructField] - [SliceIndex] - [MapIndex] - [Indirect] - [Ty

Source from the content-addressed store, hash-verified

37// - [TypeAssertion]
38// - [Transform]
39type PathStep interface {
40 String() string
41
42 // Type is the resulting type after performing the path step.
43 Type() reflect.Type
44
45 // Values is the resulting values after performing the path step.
46 // The type of each valid value is guaranteed to be identical to Type.
47 //
48 // In some cases, one or both may be invalid or have restrictions:
49 // - For StructField, both are not interface-able if the current field
50 // is unexported and the struct type is not explicitly permitted by
51 // an Exporter to traverse unexported fields.
52 // - For SliceIndex, one may be invalid if an element is missing from
53 // either the x or y slice.
54 // - For MapIndex, one may be invalid if an entry is missing from
55 // either the x or y map.
56 //
57 // The provided values must not be mutated.
58 Values() (vx, vy reflect.Value)
59}
60
61var (
62 _ PathStep = StructField{}

Callers 22

FormatDiffSliceMethod · 0.65
DiffFunction · 0.65
compareAnyMethod · 0.65
comparerTestsFunction · 0.65
reporterTestsFunction · 0.65
LessMethod · 0.65
formatDiffListMethod · 0.65
applyMethod · 0.65
CanFormatDiffSliceMethod · 0.65
FormatDiffSliceMethod · 0.65
rootStepFunction · 0.65
compareAnyMethod · 0.65

Implementers 7

pathStepcmp/path.go
StructFieldcmp/path.go
SliceIndexcmp/path.go
MapIndexcmp/path.go
Indirectcmp/path.go
TypeAssertioncmp/path.go
Transformcmp/path.go

Calls

no outgoing calls

Tested by

no test coverage detected