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

Method String

cmp/path.go:106–114  ·  view source on GitHub ↗

String returns the simplified path to a node. The simplified path only contains struct field accesses. For example: MyMap.MySlices.MyField

()

Source from the content-addressed store, hash-verified

104//
105// MyMap.MySlices.MyField
106func (pa Path) String() string {
107 var ss []string
108 for _, s := range pa {
109 if _, ok := s.(StructField); ok {
110 ss = append(ss, s.String())
111 }
112 }
113 return strings.TrimPrefix(strings.Join(ss, ""), ".")
114}
115
116// GoString returns the path to a specific node using Go syntax.
117//

Callers 1

GoStringMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected