SonarSource / sonar-go-archived

SonarGo: Go Analyzer for SonarQube
https://docs.sonarqube.org/display/PLUG/SonarGo
Other
120 stars 24 forks source link

S1871 does not account for type switches #384

Open darwish opened 5 years ago

darwish commented 5 years ago

If a variable is assigned as part of a type switch, the variable can take on the type of the given case. This means that two case blocks can have identical bodies, but operate on different types, so it is impossible to collapse them.

Example: https://play.golang.org/p/9im-kLIPcEl

Version is 6.7.7