Mon 16 January 2017
Golang接口型函数
package main import ( "fmt" ) type Handler interface { Do(k, v interface{}) } type HandlerFunc func(k, v interface{}) func (f HandlerFunc) Do(k, v interface{}) { f(k, v) } func Each(m map[interface{}]interface{}, h Handler) { for k, v := range m { h.Do(k, v) } } func EachFunc(m map[interface{}]interface ... read more