diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2025-10-12 23:30:08 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2025-10-12 23:30:08 +0530 |
commit | 327a32f563394f92313e4a751515d69d90f4e7f5 (patch) | |
tree | 9b49fd41ac852fa459b623f7fbe7c79aaac24418 /user/controller.go | |
parent | 029fe2c7a3532bc3bf435f257cdade240c8f3568 (diff) |
formatted code
Diffstat (limited to 'user/controller.go')
-rw-r--r-- | user/controller.go | 24 |
1 files changed, 12 insertions, 12 deletions
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, |