go
Google Go Style Guide
Official Google Go coding standards for idiomatic, maintainable code.
Golden Rules
- Run
gofmtbefore commit — formatting is non-negotiable - Short variable names in small scopes —
i,err,ctx - Error handling, not exceptions — check every error
- Interfaces for abstraction — accept interfaces, return structs
- Defer for cleanup — ensure resources are released
- Explicit is better — avoid magic, prefer clarity
- Package names: lowercase, single word — no underscores
Quick Reference
Naming Conventions
| Element | Convention | Example |
More from testdino-hq/google-styleguides-skills
google-styleguides-skills
Complete collection of Google's official style guides for 17 languages. Includes TypeScript, JavaScript, Python, Java, Go, C++, C#, Swift, Objective-C, HTML/CSS, AngularJS, Shell, R, Common Lisp, Vim Script, JSON, and Markdown. Production-ready coding standards used across Google's engineering organization, formatted for AI agent consumption.
4shell
Google's official Shell scripting style guide. Covers Bash scripting, naming conventions, error handling, portability, and shell best practices.
3python
Google's official Python style guide extending PEP 8. Covers type annotations, Google-style docstrings, imports, naming conventions, f-strings, comprehensions, and exception handling. Enforces 80-char line length and 4-space indentation.
3cpp
Google's official C++ style guide. Covers headers, naming conventions, formatting, classes, memory management, RAII, smart pointers, and modern C++ features.
2java
Google's official Java style guide. Covers 2-space indentation, 100-char line limit, naming conventions, braces, imports, Javadoc, exception handling, lambdas, and streams. Enforces @Override annotations and specific imports.
2typescript
Google's official TypeScript style guide. Covers strict mode, type annotations, interfaces vs types, null handling, naming conventions, imports, and common mistakes. Enforces explicit return types, readonly properties, and avoidance of any/non-null assertions.
1