github.com/elek/golangci-lint@v1.42.2-0.20211208090441-c05b7fcb3a9a/test/testdata/fix/in/whitespace.go (about) 1 //args: -Ewhitespace 2 //config: linters-settings.whitespace.multi-if=true 3 //config: linters-settings.whitespace.multi-func=true 4 package p 5 6 import "fmt" 7 8 func oneLeadingNewline() { 9 10 fmt.Println("Hello world") 11 } 12 13 func oneNewlineAtBothEnds() { 14 15 fmt.Println("Hello world") 16 17 } 18 19 func noNewlineFunc() { 20 } 21 22 func oneNewlineFunc() { 23 24 } 25 26 func twoNewlinesFunc() { 27 28 29 } 30 31 func noNewlineWithCommentFunc() { 32 // some comment 33 } 34 35 func oneTrailingNewlineWithCommentFunc() { 36 // some comment 37 38 } 39 40 func oneLeadingNewlineWithCommentFunc() { 41 42 // some comment 43 } 44 45 func twoLeadingNewlines() { 46 47 48 fmt.Println("Hello world") 49 } 50 51 func multiFuncFunc(a int, 52 b int) { 53 fmt.Println("Hello world") 54 } 55 56 func multiIfFunc() { 57 if 1 == 1 && 58 2 == 2 { 59 fmt.Println("Hello multi-line world") 60 } 61 }