News for hackers. Stuff that matters.
Re:Interface Upgrades in Go by zaphar on Sunday December 07, 2014 @10:19PM (#8714741)
For even more similar look to pattern matching look at Go's type switch.

    switch i.(type) {
        case OptionalInterface1:
           // do some extra thing we allow
        case OptionalInterface2:
           // do some other extra thing we allow
    }
It's really good when you have a set of mutually exclusive interfaces or types.
Re:Interface Upgrades in Go by jerf on Monday December 08, 2014 @09:16AM (#8716470)
You can do a passable impression of sum types that way too: http://www.jerf.org/iri/post/2917
Re:Interface Upgrades in Go by arnehormann on Monday December 08, 2014 @02:03AM (#8715326)
You should use switch v := i.(type) so you can access v as the type in a case.