Constant Casing (ARCH5006)
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Key go.naming.constant-mixedcaps · Severity info · Category naming
In Go, package-level constants should use the MixedCaps convention; the UPPER_SNAKE_CASE carried over from other languages is not idiomatic. Consistent naming improves readability.
Incorrect
Section titled “Incorrect”const MAX_RETRY_COUNT = 3const DEFAULT_TIMEOUT = 30Correct
Section titled “Correct”const MaxRetryCount = 3const DefaultTimeout = 30Remove underscores and use MixedCaps for constants.