Go

Follow gofmt, including tab indentation and automatic alignment. Use mixedCaps for unexported identifiers and MixedCaps for exported identifiers, including types and constants; initial capitalization controls visibility. Use short lowercase package names and conventional abbreviations such as ID and HTTP. These are language exceptions to the common naming table.

Keep the 100-column readability target where practical, but do not fight gofmt or treat it as a hard limit; gofmt has no configurable wrapping target. Go requires braces around control-flow bodies.

Apply the common cleanup rule using defer where its function-exit lifetime is appropriate. Check meaningful cleanup errors. Ordinary failures use error values; a goroutine still needs an owner and shutdown/failure handling.

References: Effective Go and Go code review comments.

Edit this page