Boolean Prefix (ARCH5007)
Key go.naming.boolean-prefix · Severity info · Category naming
Boolean-typed members and accessors should carry an interrogative prefix such as is/has/can/should, otherwise conditionals read poorly. The accurate form needs a type-aware mode.
Incorrect
Section titled “Incorrect”type Account struct { Active bool Premium bool}Correct
Section titled “Correct”type Account struct { IsActive bool HasPremium bool}Add an interrogative prefix like is/has/can/should to boolean fields.