docs: use real identifiers in the Godoc examples

This commit is contained in:
Julien Neuhart
2026-08-07 19:56:54 +02:00
parent de7f335791
commit 9ec7be4687

View File

@@ -121,20 +121,28 @@ Enforced by `gci`: standard library, then third-party, then `github.com/gotenber
Every exported type and function has a Godoc comment starting with its identifier name: Every exported type and function has a Godoc comment starting with its identifier name:
```go ```go
// Violation records a single rule violation with context. // OutboundDecision is the result of validating an outbound URL via
type Violation struct { ... } // [DecideOutbound]. ...
type OutboundDecision struct { ... }
// ValidatePDFA audits the document against a PDF/A profile. // DialPinned dials each addr in turn until one connects, returning the
func ValidatePDFA(ctx context.Context, ...) ([]error, error) // first successful connection or the last error. ...
func DialPinned(ctx context.Context, network string, addrs []netip.Addr, port string) (net.Conn, error)
``` ```
Each package should have a `doc.go` with a `// Package foo ...` comment. Each package should have a `doc.go` with a `// Package foo ...` comment:
```go
// Package api manages a LibreOffice instance via the UNO API.
package api
```
Reference identifiers with `[Name]` brackets for pkg.go.dev linking: Reference identifiers with `[Name]` brackets for pkg.go.dev linking:
```go ```go
// ValidatePDFA returns violations as []error where each element // Callers pass the Pinned slice from [OutboundDecision] so that the dial
// is a [Violation] value. See [Rule] for the structured fields. // targets exactly the IPs that [DecideOutbound] resolved, preventing DNS
// rebinding between validation and connect.
``` ```
### Code comments ### Code comments