// setInterfaceValue sets an interface value to a concrete value through // reflection. If the concrete value does not implement the interface, the // setting will panic. This routine turns the panic into an error return. // This dance avoids manually checking that the value satisfies the // interface. // TODO(rsc): avoid panic+recover after fixing issue 327. func setInterfaceValue(ivalue *reflect.InterfaceValue, value reflect.Value) { defer func() { if e := recover(); e != nil { error(e.(os.Error)) } }() ivalue.Set(value) }