PrintSyncMap prints a sync.Map.
(sm *sync.Map)
| 72 | |
| 73 | // PrintSyncMap prints a sync.Map. |
| 74 | func (p *Printer) PrintSyncMap(sm *sync.Map) error { |
| 75 | m := make(map[string]interface{}) |
| 76 | sm.Range(func(key, value interface{}) bool { |
| 77 | m[key.(string)] = value |
| 78 | return true |
| 79 | }) |
| 80 | if viper.IsSet("include") || viper.IsSet("exclude") { |
| 81 | m = FilterMap(m, |
| 82 | viper.GetStringSlice("include"), |
| 83 | viper.GetStringSlice("exclude")) |
| 84 | } |
| 85 | return p.Print(m) |
| 86 | } |
| 87 | |
| 88 | // ObjectToMap function that returns the attributes for an object as a map. |
| 89 | // Keys are attribute names and values are the attribute's value. Two special |