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{})
| 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. |
| 42 | func 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. |
| 53 | func (s StringSet) Insert(items ...string) StringSet { |