MCPcopy Create free account

hub / github.com/google/go-cmp / functions

Functions428 in github.com/google/go-cmp

↓ 35 callersMethodType
Type is the resulting type after performing the path step.
cmp/path.go:43
↓ 21 callersMethodEqual
Equal reports whether the two trees are structurally identical. Nested textRecord.Diff and textRecord.Comment fields are compared.
cmp/report_text.go:71
↓ 19 callersFunctionComparer
Comparer returns an [Option] that determines whether two values are equal to each other. The comparer f must be a function "func(T, T) bool" and is i
cmp/options.go:347
↓ 18 callersMethodLen
Len reports the length in bytes of a single-line version of the tree. Nested textRecord.Diff and textRecord.Comment fields are ignored.
cmp/report_text.go:68
↓ 17 callersMethodIndex
Index returns the ith step in the Path and supports negative indexing. A negative index starts counting from the tail of the Path such that -1 refers
cmp/path.go:90
↓ 17 callersMethodIsNil
IsNil reports whether the pointer is nil.
cmp/internal/value/pointer.go:27
↓ 13 callersFunctionFilterPath
FilterPath returns a new [Option] where opt is only evaluated if filter f returns true for the current [Path] in the value tree. This filter is calle
cmp/options.go:118
↓ 13 callersFunctionTransformer
Transformer returns an [Option] that applies a transformation function that converts values of a certain type into that of another. The transformer f
cmp/options.go:280
↓ 11 callersFunctionEqual
TODO(≥go1.18): Use any instead of interface{}. Equal reports whether x and y are equal by recursively applying the following rules in the given order
cmp/compare.go:95
↓ 11 callersFunctionFilterValues
FilterValues returns a new [Option] where opt is only evaluated if filter f, which is a function of the form "func(T, T) bool", returns true for the c
cmp/options.go:159
↓ 11 callersMethodName
Name is the name of the [Transformer].
cmp/path.go:311
↓ 11 callersMethodString
()
cmp/path.go:40
↓ 10 callersMethodErrorf
(format string, args ...interface{})
cmp/cmpopts/example_test.go:130
↓ 9 callersFunctionIgnore
Ignore is an [Option] that causes all comparisons to be ignored. This value is intended to be combined with [FilterPath] or [FilterValues]. It is an e
cmp/options.go:198
↓ 9 callersFunctionassert
(ok bool)
cmp/report.go:50
↓ 9 callersMethodcompareAny
(step PathStep)
cmp/compare.go:238
↓ 9 callersMethodreport
(eq bool, rf resultFlags)
cmp/compare.go:582
↓ 8 callersFunctionIsType
IsType reports whether the reflect.Type is of the specified function type.
cmp/internal/function/func.go:38
↓ 8 callersFunctionNameOf
NameOf returns the name of the function value.
cmp/internal/function/func.go:71
↓ 6 callersMethodLast
Last returns the last [PathStep] in the Path. If the path is empty, this returns a non-nil [PathStep] that reports a nil [PathStep.Type].
cmp/path.go:81
↓ 6 callersMethodValues
Values is the resulting values after performing the path step. The type of each valid value is guaranteed to be identical to Type. In some cases, one
cmp/path.go:58
↓ 6 callersMethodverbosity
()
cmp/report_compare.go:69
↓ 5 callersFunctionAllowUnexported
AllowUnexported returns an [Option] that allows [Equal] to forcibly introspect unexported fields of the specified struct types. See [Exporter] for th
cmp/options.go:422
↓ 5 callersFunctionDiff
Diff returns a human-readable report of the differences between two values: y - x. It returns an empty string if and only if Equal returns true for th
cmp/compare.go:115
↓ 5 callersFunctionDifference
Difference reports whether two lists of lengths nx and ny are equal given the definition of equality provided as f. This function returns an edit-scr
cmp/internal/diff/diff.go:138
↓ 5 callersMethodIsZero
()
cmp/report_text.go:374
↓ 5 callersMethodKey
Key is the value of the map key.
cmp/path.go:276
↓ 5 callersFunctionPointerOf
PointerOf returns a Pointer from v, which must be a reflect.Ptr, reflect.Slice, or reflect.Map.
cmp/internal/value/pointer.go:20
↓ 5 callersMethodPop
Pop ascends from pointers vx and vy.
cmp/path.go:381
↓ 4 callersMethodAppend
(ds diffStats)
cmp/report_text.go:383
↓ 4 callersMethodNumDiff
()
cmp/report_text.go:379
↓ 4 callersMethodPush
Push indicates intent to descend into pointers vx and vy where visited reports whether either has been seen before. If visited before, equal reports w
cmp/path.go:366
↓ 4 callersMethodSimilar
Similar indicates whether two symbols are similar and may be represented by using the Modified type. As a special case, we consider binary comparisons
cmp/internal/diff/diff.go:117
↓ 4 callersMethodString
()
cmp/internal/testprotos/protos.go:16
↓ 4 callersFunctionTypeString
TypeString is nearly identical to reflect.Type.String, but has an additional option to specify that full type names be used.
cmp/internal/value/name.go:16
↓ 4 callersMethodWithTypeMode
(t typeMode)
cmp/report_compare.go:60
↓ 4 callersMethodfilter
filter applies all filters and returns the option that remains. Each option may only read s.curPath and call s.callTTBFunc. An Options is returned on
cmp/options.go:32
↓ 3 callersMethodAppendEllipsis
AppendEllipsis appends a new ellipsis node to the list if none already exists at the end. If cs is non-zero it coalesces the statistics with the previ
cmp/report_text.go:153
↓ 3 callersMethodFormatType
FormatType prints the type as if it were wrapping s. This may return s as-is depending on the current type and TypeMode mode.
cmp/report_reflect.go:51
↓ 3 callersFunctionIgnoreUnexported
IgnoreUnexported returns an [cmp.Option] that only ignores the immediate unexported fields of a struct, including anonymous fields of unexported types
cmp/cmpopts/ignore.go:119
↓ 3 callersMethodOption
Option returns the originally constructed [Transformer] option. The == operator can be used to detect the exact option used.
cmp/path.go:318
↓ 3 callersFunctionSortKeys
SortKeys sorts a list of map keys, deduplicating keys if necessary. The type of each value must be comparable.
cmp/internal/value/sort.go:16
↓ 3 callersMethodcallTTBFunc
(f, x, y reflect.Value)
cmp/compare.go:347
↓ 3 callersFunctioncompareByte
compareByte returns a Result where the result is Equal if x == y, similar if x and y differ only in casing, and different otherwise.
cmp/internal/diff/diff_test.go:383
↓ 3 callersMethodformatExpandedTo
formatExpandedTo formats the contents of the tree as a multi-line string to the provided buffer. In order for column alignment to operate well, format
cmp/report_text.go:91
↓ 3 callersFunctionformatHex
formatHex prints u as a hexadecimal integer in Go notation.
cmp/report_reflect.go:393
↓ 3 callersFunctionformatPointer
formatPointer prints the address of the pointer.
cmp/report_references.go:22
↓ 3 callersMethodless
(v reflect.Value, i, j int)
cmp/cmpopts/sort.go:80
↓ 3 callersFunctionnewInt
TODO(≥go1.18): Define a generic function that boxes a value on the heap.
cmp/compare_test.go:108
↓ 3 callersMethodstats
stats returns a histogram of the number of each type of edit operation.
cmp/internal/diff/diff.go:62
↓ 2 callersFunctionBoolResult
BoolResult returns a Result that is either Equal or not Equal.
cmp/internal/diff/diff.go:100
↓ 2 callersMethodCanFormatDiffSlice
CanFormatDiffSlice reports whether we support custom formatting for nodes that are slices of primitive kinds or strings.
cmp/report_slices.go:22
↓ 2 callersFunctionEquateErrors
EquateErrors returns a [cmp.Comparer] option that determines errors to be equal if [errors.Is] reports them to match. The [AnyError] error can be used
cmp/cmpopts/equate.go:138
↓ 2 callersMethodFormatDiff
FormatDiff converts a valueNode tree into a textNode tree, where the later is a textual representation of the differences detected in the former.
cmp/report_compare.go:98
↓ 2 callersMethodFormatDiffSlice
FormatDiffSlice prints a diff for the slices (or strings) represented by v. This provides custom-tailored logic to make printing of differences in tex
cmp/report_slices.go:90
↓ 2 callersMethodFormatValue
FormatValue prints the reflect.Value, taking extra care to avoid descending into pointers already in ptrs. As pointers are visited, ptrs is also updat
cmp/report_reflect.go:114
↓ 2 callersFunctionIgnoreFields
IgnoreFields returns an [cmp.Option] that ignores fields of the given names on a single struct type. It respects the names of exported fields that are
cmp/cmpopts/ignore.go:24
↓ 2 callersFunctionIgnoreInterfaces
IgnoreInterfaces returns an [cmp.Option] that ignores all values or references of values assignable to certain interface types. These interfaces are s
cmp/cmpopts/ignore.go:66
↓ 2 callersFunctionMakeGatewayInfo
()
cmp/example_test.go:320
↓ 2 callersMethodNext
Next increments the state and reports whether a check should be performed. Checks occur every Nth function call, where N is a triangular number: 0
cmp/compare.go:651
↓ 2 callersMethodPopStep
()
cmp/options.go:517
↓ 2 callersMethodPushStep
(PathStep)
cmp/options.go:515
↓ 2 callersMethodReport
(Result)
cmp/options.go:516
↓ 2 callersFunctionReporter
Reporter is an [Option] that can be passed to [Equal]. When [Equal] traverses the value trees, it calls PushStep as it descends into each node in the
cmp/options.go:486
↓ 2 callersMethodString
String returns the string representation of the text tree. It is not guaranteed that len(x.String()) == x.Len(), nor that x.String() == y.String() imp
cmp/report_text.go:75
↓ 2 callersMethodUpdate
()
cmp/internal/diff/debug_enable.go:100
↓ 2 callersMethodappend
(t EditType)
cmp/internal/diff/diff.go:377
↓ 2 callersMethodappendChar
(b []byte, c byte)
cmp/report_text.go:56
↓ 2 callersMethodappendIndent
(b []byte, d diffMode)
cmp/report_text.go:24
↓ 2 callersFunctiondetectRaces
(c chan<- reflect.Value, f reflect.Value, vs ...reflect.Value)
cmp/compare.go:366
↓ 2 callersFunctionflattenOptions
flattenOptions copies all options in src to dst as a flat list. Only coreOptions and Options containing coreOptions are allowed.
cmp/options.go:540
↓ 2 callersMethodformatCompactTo
formatCompactTo formats the contents of the tree as a single-line string to the provided buffer. Any nested textRecord.Diff and textRecord.Comment fie
cmp/report_text.go:87
↓ 2 callersFunctionformatMapKey
formatMapKey formats v as if it were a map key. The result is guaranteed to be a single line.
cmp/report_reflect.go:359
↓ 2 callersFunctionformatString
formatString prints s as a double-quoted or backtick-quoted string.
cmp/report_reflect.go:373
↓ 2 callersFunctiongenerateStrings
(n int, px, py, pm float32, seed int64)
cmp/internal/diff/diff_test.go:310
↓ 2 callersFunctionisExported
isExported reports whether the identifier is exported.
cmp/path.go:387
↓ 2 callersFunctionisExported
isExported reports whether the identifier is exported.
cmp/cmpopts/ignore.go:146
↓ 2 callersMethodless
(v reflect.Value, i, j int)
cmp/cmpopts/sort.go:144
↓ 2 callersFunctionmakeAddressable
makeAddressable returns a value that is always addressable. It returns the input verbatim if it is already addressable, otherwise it creates a new val
cmp/compare.go:664
↓ 2 callersFunctionnewState
(opts []Option)
cmp/compare.go:188
↓ 2 callersFunctionnewStructFilter
(typ interface{}, names ...string)
cmp/cmpopts/struct_filter.go:35
↓ 2 callersFunctionnormalizeOption
normalizeOption normalizes the input options such that all Options groups are flattened and groups with a single element are reduced to that element.
cmp/options.go:527
↓ 2 callersMethodprint
(d time.Duration)
cmp/internal/diff/debug_enable.go:117
↓ 2 callersFunctionretrieveUnexportedField
retrieveUnexportedField uses unsafe to forcibly retrieve any field from a struct such that the value has read-write permissions. The parent struct, v
cmp/export.go:18
↓ 2 callersFunctionrootStep
rootStep constructs the first path step. If x and y have differing types, then they are stored within an empty interface type.
cmp/compare.go:141
↓ 2 callersMethodstatelessCompare
statelessCompare compares two values and returns the result. This function is stateless in that it does not alter the current result, or output to any
cmp/compare.go:223
↓ 2 callersFunctiontestStrings
(t *testing.T, x, y string)
cmp/internal/diff/diff_test.go:340
↓ 2 callersFunctionverbosityPreset
verbosityPreset modifies the verbosity settings given an index between 0 and maxVerbosityPreset, inclusive.
cmp/report_compare.go:84
↓ 1 callersFunctionAcyclicTransformer
AcyclicTransformer returns a [cmp.Transformer] with a filter applied that ensures that the transformer cannot be recursively applied upon its own outp
cmp/cmpopts/xform.go:33
↓ 1 callersMethodBegin
(nx, ny int, f EqualFunc, p1, p2 *EditScript)
cmp/internal/diff/debug_enable.go:72
↓ 1 callersMethodByFunc
ByFunc reports whether a [Comparer] function determined equality.
cmp/options.go:459
↓ 1 callersMethodByIgnore
ByIgnore reports whether the node is equal because it was ignored. This never reports true if [Result.Equal] reports false.
cmp/options.go:449
↓ 1 callersMethodByMethod
ByMethod reports whether the Equal method determined equality.
cmp/options.go:454
↓ 1 callersMethodCheck
Check scans the Path for any recursive transformers and panics when any recursive transformers are detected. Note that the presence of a recursive Tra
cmp/compare.go:605
↓ 1 callersMethodDist
Dist is the Levenshtein distance and is guaranteed to be 0 if and only if lists X and Y are equal.
cmp/internal/diff/diff.go:82
↓ 1 callersFunctionEquateApprox
EquateApprox returns a [cmp.Comparer] option that determines float32 or float64 values to be equal if they are within a relative fraction or absolute
cmp/cmpopts/equate.go:50
↓ 1 callersFunctionEquateApproxTime
EquateApproxTime returns a [cmp.Comparer] option that determines two non-zero [time.Time] values to be equal if they are within some margin of one ano
cmp/cmpopts/equate.go:99
↓ 1 callersFunctionEquateComparable
EquateComparable returns a [cmp.Option] that determines equality of comparable types by directly comparing them using the == operator in Go. The types
cmp/cmpopts/equate.go:166
↓ 1 callersFunctionEquateEmpty
EquateEmpty returns a [cmp.Comparer] option that determines all maps and slices with a length of zero to be equal, regardless of whether they are nil.
cmp/cmpopts/equate.go:24
↓ 1 callersFunctionEquateNaNs
EquateNaNs returns a [cmp.Comparer] option that determines float32 and float64 NaN values to be equal. EquateNaNs can be used in conjunction with [Eq
cmp/cmpopts/equate.go:81
next →1–100 of 428, ranked by callers