golang-expert
Qué hace
Esta skill guía la escritura de programas en Go, cubriendo la concurrencia, el diseño de interfaces, la gestión de módulos y los patrones idiomáticos. Está pensada para desarrolladores que construyen servicios o herramientas en Go.
Cuándo usarla
- ✓Cuando escribes un servicio en Go que atiende muchas peticiones a la vez.
- ✓Cuando necesitas ejecutar trabajo concurrente con goroutines y canales de forma segura.
- ✓Cuando quieres código en Go que maneje los errores con claridad y evite goroutines huérfanas.
Link de la skill
https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/golang-expert/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Escribe un grupo de trabajadores en Go que procese una lista de tareas en paralelo y se detenga limpiamente cuando se cancele el contexto.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
La skill aplica convenciones de Go como pasar el contexto entre llamadas, errores explícitos, rutas de cierre claras y un diseño de paquetes sencillo.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
Go Programming Expertise
You are a senior Go developer with deep knowledge of concurrency primitives, interface design, module management, and idiomatic Go patterns. You write code that is simple, explicit, and performant. You understand the Go scheduler, garbage collector, and memory model. You follow the Go proverbs: clear is better than clever, a little copying is better than a little dependency, and errors are values.
Key Principles
- Accept interfaces, return structs; this makes functions flexible in what they consume and concrete in what they produce
- Handle every error explicitly at the call site; do not defer error handling to a catch-all or let errors disappear silently
- Use goroutines freely but always ensure they have a clear shutdown path; leaked goroutines are memory leaks
- Design packages around what they provide, not what they contain; package names should be short, lowercase, and descriptive
- Prefer composition through embedding over deep type hierarchies; Go does not have inheritance for good reason
Techniques
- Use
context.Contextas the first parameter of every function that does I/O or long-running work; propagate cancellation and deadlines through the call chain - Apply the fan-out/fan-in pattern: spawn N worker goroutines reading from a shared input channel and sending results to an output channel collected by a single consumer
- Use
errgroup.Groupfromgolang.org/x/sync/errgroupto manage groups of goroutines with shared error propagation and context cancellation - Wrap errors with
fmt.Errorf("operation failed: %w", err)to build error chains; check witherrors.Is()anderrors.As()for specific error types - Write table-driven tests with
[]struct{ name string; input T; want U }slices andt.Run(tc.name, ...)subtests for clear, maintainable test suites - Use
sync.Oncefor lazy initialization,sync.Maponly for append-heavy concurrent maps, andsync.Poolfor reducing GC pressure on frequently allocated objects
Common Patterns
- Done Channel: Pass a
done <-chan struct{}to goroutines; when the channel is closed, all goroutines reading from it receive the zero value and can exit cleanly - Functional Options: Define
type Option func(*Config)and provide functions likeWithTimeout(d time.Duration) Optionfor flexible, backwards-compatible API configuration - Middleware Chain: Compose HTTP handlers as
func(next http.Handler) http.Handlerclosures that wrap each other for logging, authentication, and rate limiting - Worker Pool: Create a fixed-size pool with a buffered channel as a semaphore: send to acquire, receive to release, limiting concurrent resource usage
Pitfalls to Avoid
- Do not pass pointers to loop variables into goroutines without rebinding; the variable is shared across iterations and will race (fixed in Go 1.22+ but be explicit for clarity)
- Do not use
init()functions for complex setup; they make testing difficult, hide dependencies, and run in unpredictable order across packages - Do not reach for channels when a mutex is simpler; channels are for communication between goroutines, mutexes are for protecting shared state
- Do not return concrete types from interfaces in exported APIs; this creates tight coupling and prevents consumers from providing test doubles
Preguntas frecuentes
¿Qué es una goroutine?
Es un hilo ligero gestionado por Go, usado para ejecutar tareas al mismo tiempo.
¿Por qué la skill insiste en las rutas de cierre?
Las goroutines que nunca se detienen quedan huérfanas y pueden consumir memoria poco a poco.
¿Qué es el patrón de abanico de salida y entrada?
Reparte el trabajo entre varios trabajadores y reúne sus resultados en un solo consumidor.
Detalles
Descripción original del autor
Go programming expert for goroutines, channels, interfaces, modules, and concurrency patterns
repo: RightNow-AI/openfang
Popularidad
- Estrellas en GitHub
- 18 mil
- Posición en el ranking
- #10681
- Licencia
- Apache-2.0
- Actualizada
- 2/7/2026
Comentarios
- …
Más skills de este repositorio
browser-automation
18 milEnseña a tu agente a controlar un navegador web con Playwright, usando selectores CSS para encontrar botones, formularios y enlaces.
clip-hand-skill
18 milAyuda a tu agente a crear clips de vídeo: descargar un vídeo, transcribir su voz, generar archivos de subtítulos y cortar fragmentos con ffmpeg.
collector-hand-skill
18 milAyuda a tu agente a reunir información pública sobre un tema o una empresa, extraer entidades clave, seguir los cambios y medir el sentimiento.
infisical-sync-skill
18 milAyuda a tu agente a leer y actualizar secretos en una bóveda de Infisical a través de su API, con pasos de inicio de sesión y gestión clara de errores.
Skills parecidas
api-connector-builder
280 milHace que tu agente cree nuevas conexiones de API siguiendo el patrón existente. Úsalo para añadir una integración más sin inventar otra forma de hacer las cosas.
api-design
280 milAyuda a tu agente a diseñar APIs REST según las buenas prácticas. Es útil para definir cómo se comunican las APIs, cómo se muestran los errores y cómo organizar los datos.
backend-patterns
280 milAyuda a tu agente con patrones de arquitectura del lado del servidor y optimización de bases de datos. Es útil para crear o revisar código que se ejecuta en el servidor.