I’ll introduce how to represent sum/union/variant(-like) type in Go first.
Then, I’ll introduce ‘gosumcheck’, which is a static lint tool which checks all possible cases of type-switch. This is a post for Hatena Engineer Advent Calendar 2016 (Japanese). Sum Type in Go So, what is sum/union/variant type? From Wikipedia, In computer science, a tagged…