String returns the simplified path to a node. The simplified path only contains struct field accesses. For example: MyMap.MySlices.MyField
()
| 104 | // |
| 105 | // MyMap.MySlices.MyField |
| 106 | func (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 | // |