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/user.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'user/user.go') diff --git a/user/user.go b/user/user.go index 4d0ffcb..8f321eb 100644 --- a/user/user.go +++ b/user/user.go @@ -18,16 +18,17 @@ package user import ( - d "vidhukant.com/openbills/db" - e "vidhukant.com/openbills/errors" + "errors" + "github.com/spf13/viper" "golang.org/x/crypto/bcrypt" "gorm.io/gorm" - "github.com/spf13/viper" - "errors" + d "vidhukant.com/openbills/db" + e "vidhukant.com/openbills/errors" ) var COST int var db *gorm.DB + func init() { db = d.DB @@ -36,7 +37,7 @@ func init() { COST = viper.GetInt("cryptography.password_hashing_cost") } -var VALID_ROLES []string = []string { +var VALID_ROLES []string = []string{ "customer.*", "customer.read", "customer.write", "customer.delete", "item.*", "item.read", "item.write", "item.delete", "invoice.*", "invoice.read", "invoice.write", "invoice.delete", @@ -52,8 +53,8 @@ type Role struct { type User struct { ID uint TokenVersion uint // this can be incremented to disable existing refresh token(s) - Username string - Email string + Username string + Email string Password string Roles []Role `gorm:"constraint:OnDelete:CASCADE;"` } -- cgit v1.2.3