Closed gopherbot closed 9 years ago
http://play.golang.org/p/hX--Pf-sBe package main import "reflect" var errorType = reflect.TypeOf(make([]error, 1)).Elem() func main() { var x func() error f := reflect.MakeFunc(reflect.ValueOf(x).Type(), func([]reflect.Value) []reflect.Value { return []reflect.Value{reflect.Zero(errorType)} }) f.Call([]reflect.Value{}) }
by kin.wilson.za: