> Short version to just get a taste: 
>
>         type Time struct { 
>                 Err error 
>                 *time.Time 
>         } 
>          
>         func now(pass bool) Time { 
>                 if !pass { 
>                         return Time{Err: errors.New("not now")} 
>                 } 
>                 now := time.Now() 
>                 return Time{Time: &now} 
>         } 
>          
>         t := now(…) 
>         f t.Err != nil { 
>                 return t.Err 
>         } 
>
>
Problem is that it continues to be product type, nothing really enforces 
that you can't use t as a time.Time when t.Err is set. 

-- 
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 golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to