switch-const-test This is an example of how to use go/ast and go/parser to inspect a switch statement. Admittedly hacky :-) but it gets the job done.