auditMap converts a map of struct pointers to a map of struct names as strings. It's a convenience wrapper so that structs can be passed in by value instead of manually typing struct names as strings.
(m map[any]map[string]Action)
| 476 | // strings. It's a convenience wrapper so that structs can be passed in by value |
| 477 | // instead of manually typing struct names as strings. |
| 478 | func auditMap(m map[any]map[string]Action) Table { |
| 479 | out := make(Table, len(m)) |
| 480 | |
| 481 | for k, v := range m { |
| 482 | tableKey, tableValue := entry(k, v) |
| 483 | out[tableKey] = tableValue |
| 484 | } |
| 485 | |
| 486 | return out |
| 487 | } |
| 488 | |
| 489 | // entry is a helper function that checks the json tags to make sure all fields |
| 490 | // are tracked. And no excess fields are tracked. |