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