import ( "github.com/gogits/gogs/modules/middleware" "github.com/gin-gonic/gin" ) func main() { router := gin.Default() router.Use(middleware.ContextQueryInt("page")) router.GET("/", func(c *gin.Context) { page := c.GetInt("page") // Do something with the page parameter }) router.Run(":8080") }In the example above, the ContextQueryInt middleware is added to the router and configured to parse the "page" query parameter as an integer. The middleware function sets the parsed value on the gin.Context object as an integer, which can be accessed in subsequent middleware functions or request handlers using the GetInt method. This middleware function is part of the gogits.gogs.modules.middleware package.