On Thu, May 3, 2018 at 3:46 PM <[email protected]> wrote:
> And for those who compare if and switch arguing it is equivalent, you
> can't do type switches with an if statement.
>
Yes, you can
if r, ok := r.(*bytes.Buffer); ok {
// Use r as a *bytes.Buffer
} else if r, ok := r.(*os.File); ok {
// Use r as an *os.File
} else {
// Default case
}
>
> This is discussion is going nowhere.
>
> --
> 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/d/optout.
>
--
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/d/optout.