Fields returns a new immutable fields structure.
(pairs ...any)
| 29 | |
| 30 | // Fields returns a new immutable fields structure. |
| 31 | func Fields(pairs ...any) *F { |
| 32 | return &F{ |
| 33 | nodes: pairsToMap(pairs...), |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | // F is a Fielder that uses structural sharing to avoid copying entries. |
| 38 | // Setting a key is O(1), getting a key is O(n) (where n is the number of entries), |