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

Method String

cmp/path.go:167–176  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

165func (ps pathStep) Type() reflect.Type { return ps.typ }
166func (ps pathStep) Values() (vx, vy reflect.Value) { return ps.vx, ps.vy }
167func (ps pathStep) String() string {
168 if ps.typ == nil {
169 return "<nil>"
170 }
171 s := value.TypeString(ps.typ, false)
172 if s == "" || strings.ContainsAny(s, "{}\n") {
173 return "root" // Type too simple or complex to print
174 }
175 return fmt.Sprintf("{%s}", s)
176}
177
178// StructField is a [PathStep] that represents a struct field access
179// on a field called [StructField.Name].

Callers

nothing calls this directly

Calls 1

TypeStringFunction · 0.92

Tested by

no test coverage detected