On Monday, March 18, 2013 1:39:00 PM UTC-4, rog wrote:
you can assign to named return values in a return.
func doWork() (data []byte, err error) {
defer func() {
if rerr := recover(); rerr != nil {
data, err = myDefault, rerr
}
}()
something()
}
you can assign to named return values in a return.
func doWork() (data []byte, err error) {
defer func() {
if rerr := recover(); rerr != nil {
data, err = myDefault, rerr
}
}()
something()
}
is above), and thus can assign to variables that are accessible from inside
the function, including named return values.
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.