| name | moai-lang-go |
| description | Go 1.23+ development specialist covering Fiber, Gin, GORM, and concurrent programming patterns. Use when building high-performance microservices, CLI tools, or cloud-native applications.
|
| license | Apache-2.0 |
| compatibility | Designed for Claude Code |
| user-invocable | false |
| metadata | {"version":"1.1.0","category":"language","status":"active","updated":"2026-01-11","modularized":"false","tags":"go, golang, fiber, gin, concurrency, microservices","context7-libraries":"/gofiber/fiber, /gin-gonic/gin, /go-gorm/gorm","related-skills":"moai-lang-rust, moai-domain-backend"} |
| progressive_disclosure | {"enabled":true,"level1_tokens":100,"level2_tokens":5000} |
| triggers | {"keywords":["Go","Golang","Fiber","Gin","GORM","Echo","Chi",".go","go.mod","goroutine","channel","generics","concurrent","testing","benchmark","fuzzing","microservices","gRPC"],"languages":["go","golang"]} |
Quick Reference (30 seconds)
Go 1.23+ Development Expert for high-performance backend systems and CLI applications.
Auto-Triggers: Files with .go extension, go.mod, go.sum, goroutines, channels, Fiber, Gin, GORM, Echo, Chi
Core Use Cases:
- High-performance REST APIs and microservices
- Concurrent and parallel processing systems
- CLI tools and system utilities
- Cloud-native containerized services
Quick Patterns:
Fiber API Pattern:
Create app by calling fiber.New function. Define a get route at api/users/:id with handler function that takes fiber.Ctx and returns error. In the handler, call c.JSON with fiber.Map containing id from c.Params. Call app.Listen on port 3000.
Gin API Pattern:
Create r by calling gin.Default function. Define a GET route at api/users/:id with handler function taking gin.Context pointer. In handler, call c.JSON with status 200 and gin.H containing id from c.Param. Call r.Run on port 3000.
Goroutine with Error Handling:
Create g and ctx by calling errgroup.WithContext with context.Background. Call g.Go with function that returns processUsers with ctx. Call g.Go with function that returns processOrders with ctx. If err from g.Wait is not nil, call log.Fatal with error.
Implementation Guide (5 minutes)
Go 1.23 Language Features
New Features:
- Range over integers using for i range 10 syntax and print i
- Profile-Guided Optimization PGO 2.0
- Improved generics with better type inference
Generics Pattern:
Create generic Map function with type parameters T and U as any. Accept slice of T and function from T to U. Create result slice of U with same length. Iterate range slice setting result elements to function applied to values. Return result.
Web Framework Fiber v3
Create app with fiber.New passing fiber.Config with ErrorHandler and Prefork true. Use recover.New, logger.New, and cors.New middleware. Create api group at api/v1 path. Define routes for listUsers, getUser with id parameter, createUser, updateUser with id, and deleteUser with id. Call app.Listen on port 3000.
Web Framework Gin
Create r with gin.Default. Use cors.Default middleware. Create api group at api/v1 path. Define GET for users calling listUsers, GET for users/:id calling getUser, POST for users calling createUser. Call r.Run on port 3000.
Request Binding Pattern:
Define CreateUserRequest struct with Name and Email fields. Add json tags and binding tags for required, min length 2, and required email validation. In createUser handler, declare req variable, call c.ShouldBindJSON with pointer. If error, call c.JSON with 400 status and error. Otherwise call c.JSON with 201 and response data.