rspec/rules/S1125/go/rule.adoc
2023-12-22 10:07:51 +01:00

47 lines
612 B
Plaintext

:true: true
:false: false
:ops: !, &&, ||, ==, !=
== Why is this an issue?
include::../description.adoc[]
== How to fix it
include::../how-to-fix-it.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[]