Starting with go2 , the statement is easy to understand.
The method does nothing, it simply asserts your expectation that x < 0 .
The go method, on the other hand, has a switch .
This is good practice for assert false in the default clause, unless you absolutely expect your program to fall under this clause, that is, under normal circumstances, one of the case should be correct.
The only case on switch expects x exactly 2 .
So, to summarize, you do not expect x be greater than 0 , as the first statement says, you expect x be 2 and nothing more. Therefore, the statement is not used properly.
However, as Jeff noted, case does not have a break , which means that default will always be executed, leading in each script, to assert false .
Conclusion: The go method should always result in an error using assert false correctly, and assert x > 0 is incorrect.
source share