()
| 39 | } |
| 40 | |
| 41 | func (n Node) String() string { |
| 42 | if len(n.Properties) == 0 { |
| 43 | return "{}" |
| 44 | } |
| 45 | |
| 46 | p := make([]string, 0, len(n.Properties)) |
| 47 | for k, v := range n.Properties { |
| 48 | p = append(p, fmt.Sprintf("%s:%v", k, ToString(v))) |
| 49 | } |
| 50 | |
| 51 | s := fmt.Sprintf("{%s}", strings.Join(p, ",")) |
| 52 | return s |
| 53 | } |
| 54 | |
| 55 | // String makes Node satisfy the Stringer interface. |
| 56 | func (n Node) Encode() string { |
no test coverage detected