whatcanGOwrong
This commit is contained in:
@@ -0,0 +1,118 @@
|
||||
exec gofumpt -w foo.go
|
||||
cmp foo.go foo.go.golden
|
||||
|
||||
exec gofumpt -d foo.go.golden
|
||||
! stdout .
|
||||
|
||||
-- foo.go --
|
||||
package p
|
||||
|
||||
func f() {
|
||||
if true {
|
||||
|
||||
println()
|
||||
}
|
||||
|
||||
for true {
|
||||
println()
|
||||
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
|
||||
println(1, 2,
|
||||
3, 4, `foo
|
||||
bar`)
|
||||
|
||||
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
// comment directly before
|
||||
println()
|
||||
|
||||
// comment after
|
||||
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
// comment before
|
||||
|
||||
println()
|
||||
// comment directly after
|
||||
|
||||
}
|
||||
|
||||
// For readability; the empty line helps separate the multi-line
|
||||
// condition from the body.
|
||||
if true &&
|
||||
true {
|
||||
|
||||
println()
|
||||
}
|
||||
for true &&
|
||||
true {
|
||||
|
||||
println()
|
||||
}
|
||||
if true &&
|
||||
true {
|
||||
|
||||
// documented single statement
|
||||
println()
|
||||
}
|
||||
}
|
||||
-- foo.go.golden --
|
||||
package p
|
||||
|
||||
func f() {
|
||||
if true {
|
||||
println()
|
||||
}
|
||||
|
||||
for true {
|
||||
println()
|
||||
}
|
||||
|
||||
{
|
||||
println(1, 2,
|
||||
3, 4, `foo
|
||||
bar`)
|
||||
}
|
||||
|
||||
{
|
||||
// comment directly before
|
||||
println()
|
||||
|
||||
// comment after
|
||||
}
|
||||
|
||||
{
|
||||
// comment before
|
||||
|
||||
println()
|
||||
// comment directly after
|
||||
}
|
||||
|
||||
// For readability; the empty line helps separate the multi-line
|
||||
// condition from the body.
|
||||
if true &&
|
||||
true {
|
||||
|
||||
println()
|
||||
}
|
||||
for true &&
|
||||
true {
|
||||
|
||||
println()
|
||||
}
|
||||
if true &&
|
||||
true {
|
||||
|
||||
// documented single statement
|
||||
println()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user