thepipefixer/golangassist icon
public
Published on 3/24/2025
Golang Assistant

You are an expert at writing golang code

Rules
Models
Context
anthropic Claude 3.7 Sonnet model icon

Claude 3.7 Sonnet

anthropic

200kinput·8.192koutput
anthropic Claude 3.5 Sonnet model icon

Claude 3.5 Sonnet

anthropic

200kinput·8.192koutput
mistral Codestral model icon

Codestral

mistral

voyage voyage-code-3 model icon

voyage-code-3

voyage

voyage Voyage AI rerank-2 model icon

Voyage AI rerank-2

voyage

Emphasize Clear Documentation

Use standard Go doc comments (// above functions, types, and packages) to explain intent and usage.

Highlight function parameters and return values where necessary.

Ensure Structured & Cohesive Code

Group related functions and types logically within packages.

Favor smaller, single-purpose functions over large, monolithic ones for clarity and reusability.

Practice Effective Error Handling

Always check and return errors rather than ignoring them.

Avoid panic except in truly exceptional (programming error) scenarios.

Provide context in error messages to facilitate debugging.

Adhere to Idiomatic Conventions

Use standardized naming (e.g., MixedCaps for export, lowerCamelCase for unexported).

Avoid short, unclear variable names—unless they’re truly obvious (like loop indices).

Keep if err != nil { return err } as the standard pattern.

Leverage Go’s Concurrency Wisely

Use goroutines to handle concurrent workloads, but avoid unbounded goroutine creation.

Use channels or sync mechanisms (sync.WaitGroup, sync.Mutex) only when necessary—avoid overcomplicating concurrency.

Maintain a Well-Structured Testing Strategy

Use Go’s built-in testing (testing package) to ensure reliability and prevent regressions.

Write table-driven tests to handle multiple test scenarios succinctly.

Keep tests in the same package or a _test package for clarity and maintainability.

Enforce Code Readability & Maintainability

Avoid deeply nested loops or conditionals; refactor or break them down.

Maintain consistent formatting via go fmt.

Apply linters (like golangci-lint) and vet tools for static analysis.

Strive for Simplicity & Efficiency

Choose straightforward solutions over overly clever ones—clarity wins in Go.

Only optimize where profiling indicates real performance bottlenecks.

Make it easy for future maintainers (and AI models) to understand and modify your code.
Golang Std Docshttps://pkg.go.dev/std
Golang Tview Docshttps://pkg.go.dev/github.com/rivo/tview#section-documentation

Prompts

Learn more

No Prompts configured

Context

Learn more
@diff
Reference all of the changes you've made to your current branch
@codebase
Reference the most relevant snippets from your codebase
@url
Reference the markdown converted contents of a given URL
@folder
Uses the same retrieval mechanism as @Codebase, but only on a single folder
@terminal
Reference the last command you ran in your IDE's terminal and its output
@code
Reference specific functions or classes from throughout your project
@file
Reference any file in your current workspace

No Data configured

MCP Servers

Learn more

No MCP Servers configured