MCPcopy Create free account
hub / github.com/google/go-cmp / String

Method String

cmp/path.go:229–243  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

227func (si SliceIndex) Type() reflect.Type { return si.typ }
228func (si SliceIndex) Values() (vx, vy reflect.Value) { return si.vx, si.vy }
229func (si SliceIndex) String() string {
230 switch {
231 case si.xkey == si.ykey:
232 return fmt.Sprintf("[%d]", si.xkey)
233 case si.ykey == -1:
234 // [5->?] means "I don't know where X[5] went"
235 return fmt.Sprintf("[%d->?]", si.xkey)
236 case si.xkey == -1:
237 // [?->3] means "I don't know where Y[3] came from"
238 return fmt.Sprintf("[?->%d]", si.ykey)
239 default:
240 // [5->3] means "X[5] moved to Y[3]"
241 return fmt.Sprintf("[%d->%d]", si.xkey, si.ykey)
242 }
243}
244
245// Key is the index key; it may return -1 if in a split state
246func (si SliceIndex) Key() int {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected