tools/antithesis-go-instrumentor/scanners/coverage/instrumentor/testdata/golden/switch_oneline/input.go
raw| 1 | // name's switch has no default and its case body ends on the same line as |
| 2 | // the switch's closing brace. The synthesized "default:" clause needs a |
| 3 | // leading separator or it fuses with the preceding statement (`return "one" |
| 4 | // default:` does not parse -- auto-semicolon insertion only fires at line |
| 5 | // ends). Deliberately not gofmt-formatted; the one-line switch is the point. |
| 6 | package sample |
| 7 | |
| 8 | func name(n int) string { |
| 9 | switch n { case 1: return "one" } |
| 10 | return "many" |
| 11 | } |