github.com/nozzle/golangci-lint@v1.49.0-nz3/test/testdata/fix/in/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  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  }