How to Name Things in Go

Conventions and Best Practices

Use TitleCase for exported identifiers and lowercase for unexported ones to control visibility in Go.

Name Go identifiers using TitleCase for exported items and lowercase for unexported ones, matching the conventions seen in the standard library.

// Exported: visible outside the package
type Buffer struct {
	buf []byte
}

// Unexported: private to the package
func (b *Buffer) reset() {
	b.buf = b.buf[:0]
}

Use go fmt to automatically enforce these naming rules across your codebase.