package api import ( "net/http" "github.com/gin-gonic/gin" ) const USERNAME_PARAM string = "username" func userInfo(c *gin.Context) { username := c.Param(USERNAME_PARAM) user, err := userController.GetUser(username) if err != nil { sendError(c, err) return } c.JSON(http.StatusOK, gin.H{ "message": "user found", "user": user, }) }