SpreadInterface likes Spread, but returns a slice of interface{}
(k contract.Keyer)
| 85 | |
| 86 | // SpreadInterface likes Spread, but returns a slice of interface{} |
| 87 | func SpreadInterface(k contract.Keyer) []interface{} { |
| 88 | spreader := k.Spread() |
| 89 | out := make([]interface{}, len(spreader)) |
| 90 | for i := range k.Spread() { |
| 91 | out[i] = interface{}(spreader[i]) |
| 92 | } |
| 93 | return out |
| 94 | } |
| 95 | |
| 96 | // KeepOdd only retains the odd values in the contract.Keyer. Note: The |
| 97 | // alternating key-values count from zero. Odd values are the "value" in |