Interesting approach to emulating sum types in Go: define an interface with a placeholder function on all of the relevant types! https://www.jerf.org/iri/post/2917 Includes an example with an AST type. You can even stop people extending your interface by making your placeholder private.