github.com/vanstinator/golangci-lint@v0.0.0-20240223191551-cc572f00d9d1/test/testdata/fix/out/whitespace.go (about) 1 //golangcitest:args -Ewhitespace 2 //golangcitest:config_path testdata/configs/whitespace-fix.yml 3 //golangcitest:expected_exitcode 0 4 package p 5 6 import "fmt" 7 8 //line yaccpar:1 9 func oneLeadingNewline() { 10 fmt.Println("Hello world") 11 } 12 13 func oneNewlineAtBothEnds() { 14 fmt.Println("Hello world") 15 } 16 17 func noNewlineFunc() { 18 } 19 20 func oneNewlineFunc() { 21 22 } 23 24 func twoNewlinesFunc() { 25 26 27 } 28 29 func noNewlineWithCommentFunc() { 30 // some comment 31 } 32 33 func oneTrailingNewlineWithCommentFunc() { 34 // some comment 35 36 } 37 38 func oneLeadingNewlineWithCommentFunc() { 39 40 // some comment 41 } 42 43 func twoLeadingNewlines() { 44 fmt.Println("Hello world") 45 } 46 47 func multiFuncFunc(a int, 48 b int) { 49 50 fmt.Println("Hello world") 51 } 52 53 func multiIfFunc() { 54 if 1 == 1 && 55 2 == 2 { 56 57 fmt.Println("Hello multi-line world") 58 } 59 60 if true { 61 if true { 62 if true { 63 if 1 == 1 && 64 2 == 2 { 65 66 fmt.Println("Hello nested multi-line world") 67 } 68 } 69 } 70 } 71 } 72 73 func notGoFmted() { 74 fmt.Println("Hello world") 75 }