github.com/azazeal/revive@v1.0.9/testdata/disable-annotations2.go (about)

     1  package fixtures
     2  
     3  func foo1() {
     4  	//revive:disable-next-line:var-naming
     5  	var invalid_name = 0
     6  	var invalid_name2 = 1 //revive:disable-line:var-naming
     7  }
     8  
     9  func foo11() {
    10  	//revive:disable-next-line:var-naming I'm an Eiffel programmer thus I like underscores
    11  	var invalid_name = 0
    12  	var invalid_name2 = 1 //revive:disable-line:var-naming I'm an Eiffel programmer thus I like underscores
    13  }
    14  
    15  
    16  func foo2() {
    17  	// 		revive:disable-next-line:var-naming
    18  	//revive:disable
    19  	var invalid_name = 0
    20  	var invalid_name2 = 1
    21  }
    22  
    23  func foo3() {
    24  	//revive:enable
    25  	// revive:disable-next-line:var-naming
    26  	var invalid_name = 0
    27  	// not a valid annotation revive:disable-next-line:var-naming
    28  	var invalid_name2 = 1 // MATCH /don't use underscores in Go names; var invalid_name2 should be invalidName2/
    29  	/* revive:disable-next-line:var-naming */
    30  	var invalid_name3 = 0 // MATCH /don't use underscores in Go names; var invalid_name3 should be invalidName3/
    31  }
    32  
    33  func foo2p1() {
    34  	//revive:disable Underscores are fine
    35  	var invalid_name = 0
    36  	//revive:enable No! Underscores are not nice!
    37  	var invalid_name2 = 1 // MATCH /don't use underscores in Go names; var invalid_name2 should be invalidName2/
    38  }