github.com/songshiyun/revive@v1.1.5-0.20220323112655-f8433a19b3c5/testdata/identical-branches.go (about)

     1  package fixtures
     2  
     3  func identicalBranches() {
     4  	if true { // MATCH /both branches of the if are identical/
     5  
     6  	} else {
     7  
     8  	}
     9  
    10  	if true {
    11  
    12  	}
    13  
    14  	if true {
    15  		print()
    16  	} else {
    17  	}
    18  
    19  	if true { // MATCH /both branches of the if are identical/
    20  		print()
    21  	} else {
    22  		print()
    23  	}
    24  
    25  	if true {
    26  		if true { // MATCH /both branches of the if are identical/
    27  			print()
    28  		} else {
    29  			print()
    30  		}
    31  	} else {
    32  		println()
    33  	}
    34  
    35  	if true {
    36  		println("something")
    37  	} else {
    38  		println("else")
    39  	}
    40  }