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.