// Expert Go/Golang development including writing code, APIs, handlers, middleware, testing with go test, dependency management with go mod, and applying best practices from Context7. Use when user asks to write, modify, or debug Go code, mentions Golang, Go modules, go test, go build, REST APIs in Go, or working with .go files.
| name | go-development |
| description | Expert Go/Golang development including writing code, APIs, handlers, middleware, testing with go test, dependency management with go mod, and applying best practices from Context7. Use when user asks to write, modify, or debug Go code, mentions Golang, Go modules, go test, go build, REST APIs in Go, or working with .go files. |
| allowed-tools | Read, Write, Edit, Grep, Glob, Bash(go test:*), Bash(go build:*), Bash(go mod:*), Bash(go run:*), Bash(go fmt:*), Bash(go vet:*), mcp__context7__resolve-library-id, mcp__context7__get-library-docs, mcp__vscode-mcp__get_diagnostics, mcp__vscode-mcp__get_symbol_lsp_info, mcp__vscode-mcp__get_references |
Expert-level Go development with best practices from Context7, VSCode diagnostics integration, and comprehensive testing.
Use Context7 for up-to-date Go best practices:
/golang/go, /gin-gonic/gin, /gorilla/mux)Follow Go conventions and best practices:
Error Handling:
_)fmt.Errorf("context: %w", err)Code Structure:
Key Principles:
For detailed best practices and patterns, see reference.md
For complete code examples (REST API, testing, concurrency), see examples.md
Run tests after writing code:
# Run all tests
go test ./...
# Verbose output
go test -v ./path/to/package
# Race detection (for concurrency)
go test -race ./...
# Coverage
go test -cover ./...
If tests fail:
Test patterns:
t.Run() for subtestsFor testing examples, see reference.md and examples.md
Use VSCode diagnostics to catch issues:
Get diagnostics:
mcp__vscode-mcp__get_diagnostics
workspace_path: <absolute path>
filePaths: ["main.go", "handler.go"]
severities: ["error", "warning"]
For type errors:
mcp__vscode-mcp__get_symbol_lsp_info
workspace_path: <path>
filePath: "handler.go"
symbol: "UserHandler"
Before refactoring:
mcp__vscode-mcp__get_references
workspace_path: <path>
filePath: "service.go"
symbol: "GetUser"
Fix all errors and warnings before marking task complete.
Always format and vet code:
# Format code
go fmt ./...
# Lint and check for issues
go vet ./...
REST API Development:
net/http or frameworks (Gin, Echo, Chi)context.Context for request-scoped valuesError Handling:
errors.Is() and errors.As()Concurrency:
sync package for synchronizationTesting:
t.Run()For detailed patterns and examples, see reference.md and examples.md
# Initialize module
go mod init github.com/user/project
# Add dependency
go get github.com/gin-gonic/gin@latest
# Update dependencies
go get -u ./...
# Clean up unused, add missing
go mod tidy
# Vendor dependencies
go mod vendor
Before marking task complete:
go test ./...)go vet ./...)go fmt ./...)reference.md - Comprehensive Go guide
examples.md - Complete code examples