MCPcopy Create free account
hub / github.com/VirusTotal/vt-cli / PrintSyncMap

Method PrintSyncMap

utils/printer.go:74–86  ·  view source on GitHub ↗

PrintSyncMap prints a sync.Map.

(sm *sync.Map)

Source from the content-addressed store, hash-verified

72
73// PrintSyncMap prints a sync.Map.
74func (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

Callers

nothing calls this directly

Calls 2

PrintMethod · 0.95
FilterMapFunction · 0.85

Tested by

no test coverage detected