rspec/rules/S1871/go/exceptions.adoc

14 lines
294 B
Plaintext
Raw Permalink Normal View History

2023-10-24 14:02:02 +02:00
=== Exceptions
Blocks in an `if` chain or `case` blocks that contain a single line of code are ignored.
[source,go]
----
if a == 1 {
doSomething() //no issue, usually this is done on purpose to increase the readability
} else if a == 2 {
doSomethingElse()
} else {
doSomething()
}
----