From 327a32f563394f92313e4a751515d69d90f4e7f5 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Sun, 12 Oct 2025 23:30:08 +0530 Subject: formatted code --- user/controller.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'user/controller.go') diff --git a/user/controller.go b/user/controller.go index 7dd519a..3b8c587 100644 --- a/user/controller.go +++ b/user/controller.go @@ -18,32 +18,32 @@ package user import ( - e "vidhukant.com/openbills/errors" "github.com/gin-gonic/gin" "net/http" + e "vidhukant.com/openbills/errors" ) -func handleGetUser (ctx *gin.Context) { +func handleGetUser(ctx *gin.Context) { var user User - uId, ok := ctx.Get("UserID") - if !ok { - ctx.Error(e.ErrUnauthorized) - ctx.Abort() - return - } + uId, ok := ctx.Get("UserID") + if !ok { + ctx.Error(e.ErrUnauthorized) + ctx.Abort() + return + } - userId := uId.(uint) + userId := uId.(uint) - err := GetUserById(&user, userId) + err := GetUserById(&user, userId) if err != nil { ctx.Error(err) ctx.Abort() return } - // remove password hash from response - user.Password = "" + // remove password hash from response + user.Password = "" ctx.JSON(http.StatusOK, gin.H{ "data": user, -- cgit v1.2.3