Instruction file imported from pinecone-io/go-pinecone (
.cursor/rules/godoc.mdc). Copyright stays with the author.
GoDoc Documentation
All exported identifiers require GoDoc comments. The comment must start with the name of the symbol.
Format:
// Client holds the parameters for connecting to the Pinecone service.
// Use NewClient to create a Client instance.
type Client struct { ... }
// CreateServerlessIndex creates a new serverless Pinecone index.
// The context controls the lifetime of the request.
func (c *Client) CreateServerlessIndex(ctx context.Context, req *CreateServerlessIndexRequest) (*Index, error) { ... }
Inline examples in GoDoc comments use the // Example: convention with indented code:
// CreateServerlessIndex creates a new serverless Pinecone index.
//
// Example:
//
// pc, err := pinecone.NewClient(pinecone.NewClientParams{ApiKey: "YOUR_API_KEY"})
// if err != nil {
// log.Fatal(err)
// }
// idx, err := pc.CreateServerlessIndex(ctx, &pinecone.CreateServerlessIndexRequest{ ... })
Content: Start with what the symbol does (brief description), then how/when to use it, then examples. Include a concrete usage example for public methods where helpful.
Timeless content: Avoid dates and phrases like "new" or "recently added" in GoDoc. Focus on behavior, not when it was introduced.