A collection of Go style guides

This is a collection of style guides for Go.

Be sure to read about writing engineering guidelines before trying to adopt one of these wholesale.

(For more commentary on these, see my blog post Idiomatic Go Resources)

The Classics

Googler Talks

Go Wiki Pages

Non-Googlers

Further Reading

Corporate/Project-specific Style Guildes

General tips for Code Reviews:

My own attempt at best practices for TODO comments (extracted from existing Go practices, but otherwise mostly undocumented):

// For TODOs, BUGs, and NOTEs please use the standard form:
//
//    // TODO(username): ...
//
// The username (generally yours) means "for more information see", not
// "I claim responsibility for fixing this." Please use TODO rather than FIXME,
// XXX, HACK, etc.  This limits the number of things to grep for.
//
//    * TODO denotes missing features or functionality
//    * BUG denotes known broken code; these are displayed in godoc
//    * NOTE is used to highlight a particularly important or subtle section of code
//    * SECURITY and SECBUG are used for security related notes and issues

If you have a bug tracker, TODO(bug#) is probalby more useful as they're likely to stay static while maintainers move over time. Similarly, including dates or release versions in the comment can ensure TODOs are revisisted at appropriate times.

Find this useful? Buy me a coffee!

Owner
Similar Resources

A golang package for parsing ini-style configuration files

Mini Mini is a simple ini configuration file parser. The ini syntax supported includes: The standard name=value Comments on new lines starting with #

Jan 7, 2023

Drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags.

Description pflag is a drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags. pflag is compatible with the GNU extensions to

Nov 25, 2022

libketama-style consistent hashing in Go

===================================== ketama.go libketama-style consistent hashing in Go Author: Nolan Caudill ([email protected]) Date: 2011-06

Sep 1, 2022

Django style fixtures for Golang's excellent built-in database/sql library.

go-fixtures Django style fixtures for Golang's excellent built-in database/sql library. Currently only YAML fixtures are supported. There are two rese

Sep 26, 2022

Crash your app in style (Golang)

Crash your app in style (Golang)

panicparse Parses panic stack traces, densifies and deduplicates goroutines with similar stack traces. Helps debugging crashes and deadlocks in heavil

Jan 5, 2023

Bampf is a simple 3D arcade style game. Collect Energy Cores in order to finish a level. Teleport (bampf) to safety or use cloaking abilities to avoid Sentinels.

Bampf Bampf is a simple 3D arcade style game. Collect energy cores in order to finish a level. Teleport (bampf) to safety or use cloaking abilities to

Dec 12, 2022

package for building REST-style Web Services using Go

go-restful package for building REST-style Web Services using Google Go Code examples using v3 REST asks developers to use HTTP methods explicitly and

Jan 1, 2023

FactorLog is a logging infrastructure for Go that provides numerous logging functions for whatever your style may be

FactorLog is a logging infrastructure for Go that provides numerous logging functions for whatever your style may be

FactorLog FactorLog is a fast logging infrastructure for Go that provides numerous logging functions for whatever your style may be. It could easily b

Aug 3, 2022

An ERB-style templating language for Go.

Ego Ego is an ERb style templating language for Go. It works by transpiling templates into pure Go and including them at compile time. These templates

Jan 6, 2023

Easy AWK-style text processing in Go

awk Description awk is a package for the Go programming language that provides an AWK-style text processing capability. The package facilitates splitt

Jul 25, 2022

package for building REST-style Web Services using Go

go-restful package for building REST-style Web Services using Google Go Code examples using v3 REST asks developers to use HTTP methods explicitly and

Jan 1, 2023

PostgreSQL style Parser splitted from CockroachDB

What's this PostgreSQL style Parser splitted from CockroachDB See: Complex SQL format example

Jan 5, 2023

🐶 Kubernetes CLI To Manage Your Clusters In Style!

🐶 Kubernetes CLI To Manage Your Clusters In Style!

K9s - Kubernetes CLI To Manage Your Clusters In Style! K9s provides a terminal UI to interact with your Kubernetes clusters. The aim of this project i

Jan 9, 2023

Go library for Common Lisp format style output

format This library has the goal to bring the Common Lisp format directive to Go. This is work-in-progress, see the summary implementation table below

Jul 7, 2020

Advanced ANSI style & color support for your terminal applications

Advanced ANSI style & color support for your terminal applications

termenv lets you safely use advanced styling options on the terminal. It gathers information about the terminal environment in terms of its ANSI & col

Dec 31, 2022

Go structure annotations that supports encoding and decoding; similar to C-style bitfields. Supports bitfield packing, self-describing layout parameters, and alignment.

Go structure annotations that supports encoding and decoding; similar to C-style bitfields. Supports bitfield packing, self-describing layout parameters, and alignment.

STRUCTure EXtensions structex provides annotation rules that extend Go structures for implementation of encoding and decoding of byte backed data fram

Oct 13, 2022

Style definitions for nice terminal layouts 👄

Style definitions for nice terminal layouts 👄

Lip Gloss Style definitions for nice terminal layouts. Built with TUIs in mind. Lip Gloss takes an expressive, declarative approach to terminal render

Dec 28, 2022
Comments
  • Add

    Add "How to Do Code Reviews Like a Human"

    I saw your tweet soliciting code review resources (https://twitter.com/dgryski/status/1321544755298250752), so I thought I'd share one I wrote a few years ago. Feel free to merge if you like it or decline if it doesn't line up with your view of good code review practices.

Tree style (files) explorer for p9p acme.

xplor, a tree-style (file) explorer for (plan9port) Acme screenshot, regular screenshot, monospaced Xplor is written for Acme, the Plan 9 text editing

Nov 25, 2021
A Controller written in kubernetes sample-controller style which watches a custom resource named Bookstore

bookstore-sample-controller A Controller written in kubernetes sample-controller style which watches a custom resource named Bookstore. A resource cre

Jan 20, 2022
⚔️ Web Hacker's Weapons / A collection of cool tools used by Web hackers. Happy hacking , Happy bug-hunting
⚔️ Web Hacker's Weapons / A collection of cool tools used by Web hackers. Happy hacking , Happy bug-hunting

A collection of cool tools used by Web hackers. Happy hacking , Happy bug-hunting Family project Table of Contents WHW-Tools Weapons Awesome Bookmarkl

Jan 5, 2023
A collection of commands for work done on GitHub

gh_sugar A collection of commands for work done on GitHub command pr Create pull request. Usage of pr: -from string from branch -owner str

Oct 19, 2021
Collection of mini-programs demonstrating Kubernetes client-go usage.

Kubernetes client-go examples Collection of mini-programs covering various client-go use cases. The intention (at least so far) is to test (more or le

Jan 3, 2023
Fadvisor(FinOps Advisor) is a collection of exporters which collect cloud resource pricing and billing data guided by FinOps, insight cost allocation for containers and kubernetes resource
Fadvisor(FinOps Advisor) is a collection of exporters which collect cloud resource pricing and billing data guided by FinOps, insight cost allocation for containers and kubernetes resource

[TOC] Fadvisor: FinOps Advisor fadvisor(finops advisor) is used to solve the FinOps Observalibility, it can be integrated with Crane to help users to

Jan 3, 2023
K8s - A Collection of tools, hands-on walkthroughs with source code
K8s - A Collection of tools, hands-on walkthroughs with source code

The Ultimate Engineer Toolbox ?? ?? A Collection of tools, hands-on walkthroughs

Feb 14, 2022
LeetCode in Go with the code style strictly follows the Google Golang Style Guide
LeetCode in Go with the code style strictly follows the Google Golang Style Guide

LeetCode in Go LeetCode Online Judge is a website containing many algorithm questions. Most of them are real interview questions of Google, Facebook,

Nov 13, 2021
LevelDB style LRU cache for Go, support non GC object.

Go语言QQ群: 102319854, 1055927514 凹语言(凹读音“Wa”)(The Wa Programming Language): https://github.com/wa-lang/wa LRU Cache Install go get github.com/chai2010/c

Jul 5, 2020
Drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags.

Description pflag is a drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags. pflag is compatible with the GNU extensions to

Dec 30, 2022