On Sat, 8 Jun 2019 17:25:11 -0400
Michael Ellis <michael.f.el...@gmail.com> wrote:

> Oops, got that the wrong way round. Should read "allow passing a Bar for
> argument of type Foo".
type Foo int
type Bar = Foo

func main() {
        var fo Foo = 1
        var ba Bar = 77
        upbar(fo, "Foo")
        upbar(ba, "Bar")

}

func upbar(d Foo, s string) {
        fmt.Printf("%s is %d\n", s, d)
}

https://play.golang.org/p/rubYGaCep6j


> Cheers,
> Mike

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/20190609004607.64c615fc%40zuzia.
For more options, visit https://groups.google.com/d/optout.

Reply via email to