go-style
Go Style
Write Go code that is readable, maintainable, and predictable. Favour clarity over cleverness; the language is small on purpose.
For the comprehensive idiomatic reference, see references/idioms.md. For
the catalogue of language gotchas, see references/pitfalls.md.
Decision shortcuts
Naming
- Packages: lowercase, singular, no underscores, no
util/common/helpers. Name describes purpose. - Variable length tracks scope:
iin a tight loop,customerOrderHistoryacross a long function. - Getters omit
Get; setters useSet.obj.Owner(),obj.SetOwner(u). - Acronyms keep consistent case:
URL,ID,HTTP— neverUrl,Id,Http.
More from marsolab/skills
sys-arch
Design production-grade software systems with expert knowledge of architecture patterns, distributed systems, cloud platforms, and operational excellence. Use this skill when architecting complex systems, evaluating technology choices, designing scalable infrastructure, or making critical architectural decisions requiring trade-off analysis.
22front-dev
>-
22go-dev
>-
21copy
Professional copywriter for SaaS and startups. Expert in landing page copy, positioning, messaging, conversion optimization, and voice-of-customer research. Use when writing compelling copy for SaaS products, landing pages, marketing materials, or when you need help with product positioning and messaging strategy.
12apple-dev
Comprehensive macOS and iOS development expertise covering Swift best practices, SwiftUI design patterns, Human Interface Guidelines, Apple frameworks, and performance optimization. Use when developing native Apple applications, implementing SwiftUI interfaces, working with Apple frameworks (Foundation, UIKit, AppKit, Core Data, CloudKit, etc.), optimizing app performance, following HIG principles, or writing production-quality Swift code for iOS, macOS, watchOS, or tvOS platforms.
6go-sql
>-
2