This kind of code might be generated by the switch implementation of func values. The func value is represented as a ptrtoint, and before calling it, it is compared against 0.