package middlewares import ( "net/http" "github.com/gin-gonic/gin" ) func Auth() gin.HandlerFunc { return func(c *gin.Context) { if 1 < 2 { c.JSON(http.StatusUnauthorized, gin.H{"error": "Unauthorized"}) c.Abort() } else { c.Next() } } }