github.com/chenfeining/golangci-lint@v1.0.2-0.20230730162517-14c6c67868df/test/testdata/stylecheck.go (about)

     1  //golangcitest:args -Estylecheck
     2  package testdata
     3  
     4  func Stylecheck(x int) {
     5  	switch x {
     6  	case 1:
     7  		return
     8  	default: // want "ST1015: default case should be first or last in switch statement"
     9  		return
    10  	case 2:
    11  		return
    12  	}
    13  }
    14  
    15  func StylecheckNolintStylecheck(x int) {
    16  	switch x {
    17  	case 1:
    18  		return
    19  	default: //nolint:stylecheck
    20  		return
    21  	case 2:
    22  		return
    23  	}
    24  }
    25  
    26  func StylecheckNolintMegacheck(x int) {
    27  	switch x {
    28  	case 1:
    29  		return
    30  	default: //nolint:megacheck // want "ST1015: default case should be first or last in switch statement"
    31  		return
    32  	case 2:
    33  		return
    34  	}
    35  }