← ClaudeAtlas

go-documentationlisted

Guidelines for Go documentation including doc comments, package docs, godoc formatting, runnable examples, and signal boosting. Use when writing or reviewing documentation for Go packages, types, functions, or methods.
dwana1/golang-skills · ★ 0 · Data & Documents · score 72
Install: claude install-skill dwana1/golang-skills
# Go Documentation This skill covers documentation conventions from Google's Go Style Guide. --- ## Doc Comments > **Normative**: All top-level exported names must have doc comments. ### Basic Rules 1. Begin with the name of the object being described 2. An article ("a", "an", "the") may precede the name 3. Use full sentences (capitalized, punctuated) ```go // Good: // A Request represents a request to run a command. type Request struct { ... // Encode writes the JSON encoding of req to w. func Encode(w io.Writer, req *Request) { ... ``` ### Struct Documentation ```go // Good: // Options configure the group management service. type Options struct { // General setup: Name string Group *FooGroup // Dependencies: DB *sql.DB // Customization: LargeGroupThreshold int // optional; default: 10 MinimumMembers int // optional; default: 2 } ``` Unexported types/functions with unobvious behavior should also have doc comments. Use the same style to make future exporting easy. --- ## Comment Sentences > **Normative**: Documentation comments must be complete sentences. - Capitalize the first word, end with punctuation - Exception: may begin with uncapitalized identifier if clear - End-of-line comments for struct fields can be phrases: ```go // Good: // A Server handles serving quotes from Shakespeare. type Server struct { // BaseDir points to the base directory for Shakespeare's works. // // Expected structure: // {B