Dev Tools · 1h ago
Go Naming: Why Getters Drop the Get Prefix
Go's official style guide mandates that getter methods omit the "Get" prefix, using the field name directly (e.g., Owner() instead of GetOwner()). The standard library follows this convention, and linters flag violations. The Set prefix remains for mutators to clearly signal mutation.
Meridian48 take
This is a minor but concrete style rule that can trip up developers from other languages, but it's well-documented and enforced by tooling.
Read the full reporting
Go Naming: Why Getters Drop the Get Prefix (and Other Idioms) →
DEV Community
go-namingcode-style