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