github.com/golangci/go-tools@v0.0.0-20190318060251-af6baa5dc196/stylecheck/testdata/src/CheckDefaultCaseOrder/CheckDefaultCaseOrder.go (about)

     1  // Package pkg ...
     2  package pkg
     3  
     4  func fn(x int) {
     5  	switch x {
     6  	}
     7  	switch x {
     8  	case 1:
     9  	}
    10  
    11  	switch x {
    12  	case 1:
    13  	case 2:
    14  	case 3:
    15  	}
    16  
    17  	switch x {
    18  	default:
    19  	}
    20  
    21  	switch x {
    22  	default:
    23  	case 1:
    24  	}
    25  
    26  	switch x {
    27  	case 1:
    28  	default:
    29  	}
    30  
    31  	switch x {
    32  	case 1:
    33  	default: // MATCH "default case should be first or last in switch statement"
    34  	case 2:
    35  	}
    36  }