I wrote this code and I’m getting an error that this fmt.Errorf line would never be used. All the other cases seem to match up correctly but when I give command a value that doesn’t match…shouldn’t it fall through?
switch {
case strings.EqualFold("WRITE", command):
fmt.Println("WRITING!")
case strings.EqualFold("READ", command):
fmt.Println("READING!")
case strings.EqualFold("START", command):
fmt.Println("STARING!")
case strings.EqualFold("DELETE", command):
fmt.Println("DELETING!")
case strings.EqualFold("COMMIT", command):
fmt.Println("COMMITTING!")
case strings.EqualFold("ABORT", command):
fmt.Println("ABORTING!")
case strings.EqualFold("QUIT", command):
fmt.Println("QUITTING!")
default:
fmt.Errorf("NO MATCH")
}