github.com/vanstinator/golangci-lint@v0.0.0-20240223191551-cc572f00d9d1/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  //line yaccpar:1
     9  func oneLeadingNewline() {
    10  
    11  	fmt.Println("Hello world")
    12  }
    13  
    14  func oneNewlineAtBothEnds() {
    15  
    16  	fmt.Println("Hello world")
    17  
    18  }
    19  
    20  func noNewlineFunc() {
    21  }
    22  
    23  func oneNewlineFunc() {
    24  
    25  }
    26  
    27  func twoNewlinesFunc() {
    28  
    29  
    30  }
    31  
    32  func noNewlineWithCommentFunc() {
    33  	// some comment
    34  }
    35  
    36  func oneTrailingNewlineWithCommentFunc() {
    37  	// some comment
    38  
    39  }
    40  
    41  func oneLeadingNewlineWithCommentFunc() {
    42  
    43  	// some comment
    44  }
    45  
    46  func twoLeadingNewlines() {
    47  
    48  
    49  	fmt.Println("Hello world")
    50  }
    51  
    52  func multiFuncFunc(a int,
    53  	b int) {
    54  	fmt.Println("Hello world")
    55  }
    56  
    57  func multiIfFunc() {
    58  	if 1 == 1 &&
    59  		2 == 2 {
    60  		fmt.Println("Hello multi-line world")
    61  	}
    62  
    63  	if true {
    64  		if true {
    65  			if true {
    66  				if 1 == 1 &&
    67  					2 == 2 {
    68  						fmt.Println("Hello nested multi-line world")
    69  				}
    70  			}
    71  		}
    72  	}
    73  }
    74  
    75  func notGoFmted() {
    76           
    77          
    78  
    79  
    80           fmt.Println("Hello world")
    81  
    82  			
    83                 
    84  }