rspec/rules/S1125/go/rule.adoc
2023-10-13 13:50:06 +02:00

43 lines
560 B
Plaintext

:true: true
:false: false
:ops: !, &&, ||, ==, !=
== Why is this an issue?
include::../description.adoc[]
=== Code examples
==== Noncompliant code example
[source,go,diff-id=1,diff-type=noncompliant]
----
if boolFunc() || false {
// ...
}
flag := x && true
----
==== Compliant solution
[source,go,diff-id=1,diff-type=compliant]
----
if boolFunc() {
// ...
}
flag := x
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
'''
endif::env-github,rspecator-view[]