nedrocks / switch-const-test

Simple golang unit test to test that switches contain all consts in a file

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

Simple golang unit test to test that switches contain all consts in a file

License:MIT License


Languages

Language:Go 100.0%