testdata/script/block-empty.txtar
raw| 1 | exec gofumpt -w foo.go |
| 2 | cmp foo.go foo.go.golden |
| 3 | |
| 4 | exec gofumpt -d foo.go.golden |
| 5 | ! stdout . |
| 6 | |
| 7 | -- foo.go -- |
| 8 | package p |
| 9 | |
| 10 | func f() { |
| 11 | if true { |
| 12 | // lone comment |
| 13 | } |
| 14 | { |
| 15 | |
| 16 | } |
| 17 | |
| 18 | { |
| 19 | |
| 20 | // lone comment |
| 21 | |
| 22 | } |
| 23 | |
| 24 | type S struct { |
| 25 | |
| 26 | |
| 27 | // lone comment |
| 28 | |
| 29 | |
| 30 | } |
| 31 | |
| 32 | type I interface { |
| 33 | |
| 34 | |
| 35 | // lone comment |
| 36 | |
| 37 | |
| 38 | } |
| 39 | |
| 40 | |
| 41 | } |
| 42 | |
| 43 | type SOut struct { |
| 44 | |
| 45 | // lone comment |
| 46 | |
| 47 | } |
| 48 | |
| 49 | type IOut interface { |
| 50 | |
| 51 | |
| 52 | // lone comment |
| 53 | |
| 54 | |
| 55 | } |
| 56 | -- foo.go.golden -- |
| 57 | package p |
| 58 | |
| 59 | func f() { |
| 60 | if true { |
| 61 | // lone comment |
| 62 | } |
| 63 | { |
| 64 | } |
| 65 | |
| 66 | { |
| 67 | // lone comment |
| 68 | } |
| 69 | |
| 70 | type S struct { |
| 71 | // lone comment |
| 72 | } |
| 73 | |
| 74 | type I interface { |
| 75 | // lone comment |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | type SOut struct { |
| 80 | // lone comment |
| 81 | } |
| 82 | |
| 83 | type IOut interface { |
| 84 | // lone comment |
| 85 | } |