From partme-ai-full-stack-skills
Guides building REST APIs and HTTP services in Go using Gin-Gonic framework, covering routing, route groups, middleware, JSON binding, validation, error handling, and graceful shutdown.
npx claudepluginhub partme-ai/full-stack-skills --plugin t2ui-skillsThis skill uses the workspace's default tool permissions.
Use this skill whenever the user wants to:
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Use this skill whenever the user wants to:
gin.Default() includes Logger and Recovery middlewareShouldBindJSON or ShouldBindQuery with struct tagsc.JSON() for consistent API responsespackage main
import (
"net/http"
"github.com/gin-gonic/gin"
)
type CreateUserRequest struct {
Name string `json:"name" binding:"required,min=2"`
Email string `json:"email" binding:"required,email"`
}
func main() {
r := gin.Default()
// Route group with auth middleware
api := r.Group("/api/v1")
{
api.POST("/users", createUser)
api.GET("/users/:id", getUser)
}
r.Run(":8080")
}
func createUser(c *gin.Context) {
var req CreateUserRequest
if err := c.ShouldBindJSON(&req); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
// ... create user logic
c.JSON(http.StatusCreated, gin.H{"name": req.Name, "email": req.Email})
}
func getUser(c *gin.Context) {
id := c.Param("id")
c.JSON(http.StatusOK, gin.H{"id": id})
}
/api/v1/users)binding:"required,email" for declarative validationhttp.Server with srv.Shutdown(ctx) for clean connection draininggin.New() and add only the middleware you needgin-gonic, gin, Go, web framework, REST API, routing, middleware, JSON binding, 路由, 中间件