con un clic
golang-dev
Use when writing Go code, structuring packages, handling errors, managing concurrency, writing tests, or building deployable Go applications.
Menú
Use when writing Go code, structuring packages, handling errors, managing concurrency, writing tests, or building deployable Go applications.
Use when designing REST or GraphQL endpoints, defining request/response schemas, or establishing API versioning and authentication conventions.
Use when writing end-to-end tests with Playwright, setting up Page Object Model, or configuring E2E test CI/CD with artifact management.
Use when building web components, pages, or visually distinctive interfaces where design quality matters as much as code quality.
Use when reviewing contracts or legal documents for Chinese law risks. 中国法律风险审查专家,识别高危条款并提供修改建议。
Use when design document needs user review - auto-opens browser to render MD content
Use when writing Python code, setting up tests with pytest, or configuring Python application deployment.
| name | golang-dev |
| description | Use when writing Go code, structuring packages, handling errors, managing concurrency, writing tests, or building deployable Go applications. |
| metadata | {"author":"skills-team"} |
Invoke test-driven-development skill when implementing features via TDD.
| Problem | Solution |
|---|---|
| Error handling | Sentinel errors + %w wrapping |
| Interface design | Accept interfaces, return structs |
| Concurrency | errgroup, buffered channels, context propagation |
| Configurable structs | Functional options pattern |
| Shared state | sync.Mutex |
Key idioms:
context.Context as first parameter for cancellation/timeoutCGO_ENABLED=0See references/patterns.md for detailed error handling, concurrency, and struct patterns.
| Type | Pattern |
|---|---|
| Table-driven tests | Define test cases as struct, iterate with t.Run() |
| Mocking | Interface-based mocking (define in consumer package) |
| Benchmarks | b.ResetTimer(), run with -bench=. -benchmem |
| Fuzzing | f.Fuzz() with f.Add() seed values |
See references/testing.md for complete testing patterns.
| Task | Command |
|---|---|
| Static build | CGO_ENABLED=0 go build -ldflags="-s -w" |
| Pre-deploy | go vet, golangci-lint run, go test -race |
See references/deployment.md for multi-stage Dockerfile, distroless images.
| DO | DON'T |
|---|---|
| Handle all errors explicitly | Ignore errors with _, _ = ... |
| Context as first parameter | Pass context in structs |
Use sync.Pool for frequent allocations | Use time.Sleep() in tests |
| Preallocate slices | Run containers as root |