github.com/vanstinator/golangci-lint@v0.0.0-20240223191551-cc572f00d9d1/test/testdata/exhaustive_default.go (about)

     1  //golangcitest:args -Eexhaustive
     2  //golangcitest:config_path testdata/configs/exhaustive_default.yml
     3  //golangcitest:expected_exitcode 0
     4  package testdata
     5  
     6  type Direction int
     7  
     8  const (
     9  	North Direction = iota
    10  	East
    11  	South
    12  	West
    13  )
    14  
    15  // Should not report missing cases in the switch statement below even though
    16  // some enum members (East, West) are not listed, because the switch statement
    17  // has a 'default' case and the default-signifies-exhaustive setting is true.
    18  
    19  func processDirectionDefault(d Direction) {
    20  	switch d {
    21  	case North, South:
    22  	default:
    23  	}
    24  }