MCPcopy Create free account
hub / github.com/DNAProject/DNA / StringKeySet

Function StringKeySet

p2pserver/common/set/string_set.go:42–50  ·  view source on GitHub ↗

StringKeySet creates a StringSet from a keys of a map[string](? extends interface{}). If the value passed in is not actually a map, this will panic.

(theMap interface{})

Source from the content-addressed store, hash-verified

40// StringKeySet creates a StringSet from a keys of a map[string](? extends interface{}).
41// If the value passed in is not actually a map, this will panic.
42func StringKeySet(theMap interface{}) StringSet {
43 v := reflect.ValueOf(theMap)
44 ret := StringSet{}
45
46 for _, keyValue := range v.MapKeys() {
47 ret.Insert(keyValue.Interface().(string))
48 }
49 return ret
50}
51
52// Insert adds items to the set.
53func (s StringSet) Insert(items ...string) StringSet {

Callers

nothing calls this directly

Calls 1

InsertMethod · 0.95

Tested by

no test coverage detected