You're viewing the English version. Switch to Chinese →
Go Gin is the most popular web framework for Go, covering router setup, GET/POST handlers, JSON responses, and HTTP server startup basics.
router := gin.Default()
router.GET("/ping", func(c *gin.Context) {
c.JSON(200, gin.H{
"message": "pong",
})
})
router.Run()
Was this page helpful?