Go

Go

Made by DeepSource

true is implicit in switch statements CRT-A0015

Anti-pattern
Minor
Autofix

If no tag is given with switch, it assumes true.

There is no need to pass the value true. It could be omitted from switch.

Bad practice

switch true {
case x > y:
}

Recommended

switch {
case x > y:
}

Example:

switch true {
case x > y:
}

can be written as:

switch {
case x > y:
}