(pairs ...any)
| 57 | } |
| 58 | |
| 59 | func pairsToMap(pairs ...any) map[string]any { |
| 60 | if len(pairs)%2 != 0 { |
| 61 | panic("Uneven number of key-value pairs passed") |
| 62 | } |
| 63 | nodes := make(map[string]any) |
| 64 | var key string |
| 65 | for i, node := range pairs { |
| 66 | if i%2 == 0 { |
| 67 | key = fmt.Sprintf("%v", node) |
| 68 | } else { |
| 69 | nodes[key] = node |
| 70 | } |
| 71 | } |
| 72 | return nodes |
| 73 | } |
| 74 | |
| 75 | // Fields implements Fielder. Returns all fields in O(n), where n is the number of entries in the map. |
| 76 | func (f *F) Fields() map[string]any { |