From b0df8b9db5044c78cf7f94628615c0e93cd0a508 Mon Sep 17 00:00:00 2001 From: NikhilSharma03 Date: Wed, 27 Dec 2023 17:36:13 +0530 Subject: [PATCH] fix: lint --- cli/cmd/expense_get.go | 6 +++--- cli/cmd/expense_history.go | 8 ++++---- cli/cmd/expense_new.go | 4 ++-- cli/cmd/expense_update.go | 6 +++--- cli/cmd/user_balance.go | 8 ++++---- cli/cmd/user_delete.go | 8 ++++---- cli/cmd/user_login.go | 8 ++++---- cli/cmd/user_new.go | 8 ++++---- cli/cmd/user_update.go | 8 ++++---- 9 files changed, 32 insertions(+), 32 deletions(-) diff --git a/cli/cmd/expense_get.go b/cli/cmd/expense_get.go index 7eb8d0c..12382a9 100644 --- a/cli/cmd/expense_get.go +++ b/cli/cmd/expense_get.go @@ -3,7 +3,7 @@ package cmd import ( "encoding/json" "fmt" - "io/ioutil" + "io" "log" "net/http" "os" @@ -30,7 +30,7 @@ var expGetCmd = &cobra.Command{ Short: "Get single transaction details", Long: ` The get command is used to get single transaction details - + Example: okane expense get --id/-I {expenseID} `, @@ -58,7 +58,7 @@ Example: if err != nil { log.Fatalf(err.Error()) } - body, err := ioutil.ReadAll(res.Body) + body, err := io.ReadAll(res.Body) if err != nil { log.Fatalf(err.Error()) } diff --git a/cli/cmd/expense_history.go b/cli/cmd/expense_history.go index 4899ce9..8f9ceae 100644 --- a/cli/cmd/expense_history.go +++ b/cli/cmd/expense_history.go @@ -3,7 +3,7 @@ package cmd import ( "encoding/json" "fmt" - "io/ioutil" + "io" "log" "net/http" "os" @@ -45,9 +45,9 @@ var expHistoryCmd = &cobra.Command{ Short: "Get transaction history", Long: ` The history command is used to get transaction history - + Example: - okane expense history + okane expense history `, Run: func(cmd *cobra.Command, args []string) { // Check if user is logged in @@ -68,7 +68,7 @@ Example: if err != nil { log.Fatalf(err.Error()) } - body, err := ioutil.ReadAll(res.Body) + body, err := io.ReadAll(res.Body) if err != nil { log.Fatalf(err.Error()) } diff --git a/cli/cmd/expense_new.go b/cli/cmd/expense_new.go index 2941283..6ad767f 100644 --- a/cli/cmd/expense_new.go +++ b/cli/cmd/expense_new.go @@ -4,7 +4,7 @@ import ( "bytes" "encoding/json" "fmt" - "io/ioutil" + "io" "log" "net/http" "os" @@ -172,7 +172,7 @@ Example: if err != nil { log.Fatalf(err.Error()) } - body, err = ioutil.ReadAll(res.Body) + body, err = io.ReadAll(res.Body) if err != nil { log.Fatalf(err.Error()) } diff --git a/cli/cmd/expense_update.go b/cli/cmd/expense_update.go index dc566cc..f441b63 100644 --- a/cli/cmd/expense_update.go +++ b/cli/cmd/expense_update.go @@ -4,7 +4,7 @@ import ( "bytes" "encoding/json" "fmt" - "io/ioutil" + "io" "log" "net/http" "os" @@ -59,7 +59,7 @@ Example: if err != nil { log.Fatalf(err.Error()) } - body, err := ioutil.ReadAll(res.Body) + body, err := io.ReadAll(res.Body) if err != nil { log.Fatalf(err.Error()) } @@ -218,7 +218,7 @@ Example: if err != nil { log.Fatalf(err.Error()) } - body, err = ioutil.ReadAll(res.Body) + body, err = io.ReadAll(res.Body) if err != nil { log.Fatalf(err.Error()) } diff --git a/cli/cmd/user_balance.go b/cli/cmd/user_balance.go index 5467cb1..e75e9b9 100644 --- a/cli/cmd/user_balance.go +++ b/cli/cmd/user_balance.go @@ -3,7 +3,7 @@ package cmd import ( "encoding/json" "fmt" - "io/ioutil" + "io" "log" "net/http" "os" @@ -41,9 +41,9 @@ var balanceCmd = &cobra.Command{ Short: "Shows user balance", Long: ` The balance command is used to see current login user balance - + Example: - okane user balance + okane user balance `, Run: func(cmd *cobra.Command, args []string) { // Check if user has already login @@ -87,7 +87,7 @@ Example: if err != nil { log.Fatalf(err.Error()) } - body, err := ioutil.ReadAll(res.Body) + body, err := io.ReadAll(res.Body) if err != nil { log.Fatalf(err.Error()) } diff --git a/cli/cmd/user_delete.go b/cli/cmd/user_delete.go index d2e6cde..c3382b0 100644 --- a/cli/cmd/user_delete.go +++ b/cli/cmd/user_delete.go @@ -3,7 +3,7 @@ package cmd import ( "encoding/json" "fmt" - "io/ioutil" + "io" "log" "net/http" "os" @@ -25,9 +25,9 @@ var deleteCmd = &cobra.Command{ Short: "Delete user", Long: ` The delete command is used to delete the current login user - + Example: - okane user delete + okane user delete `, Run: func(cmd *cobra.Command, args []string) { // Check if user is login @@ -71,7 +71,7 @@ Example: if err != nil { log.Fatalf(err.Error()) } - body, err := ioutil.ReadAll(res.Body) + body, err := io.ReadAll(res.Body) if err != nil { log.Fatalf(err.Error()) } diff --git a/cli/cmd/user_login.go b/cli/cmd/user_login.go index bee00b4..400eb27 100644 --- a/cli/cmd/user_login.go +++ b/cli/cmd/user_login.go @@ -3,7 +3,7 @@ package cmd import ( "encoding/json" "fmt" - "io/ioutil" + "io" "log" "net/http" "os" @@ -37,9 +37,9 @@ var loginCmd = &cobra.Command{ Short: "Login as a user", Long: ` The login command is used to login as a user - + Example: - okane user login + okane user login `, Run: func(cmd *cobra.Command, args []string) { // Getting user email @@ -94,7 +94,7 @@ Example: if err != nil { log.Fatalf(err.Error()) } - body, err := ioutil.ReadAll(res.Body) + body, err := io.ReadAll(res.Body) if err != nil { log.Fatalf(err.Error()) } diff --git a/cli/cmd/user_new.go b/cli/cmd/user_new.go index 02bb001..b76e770 100644 --- a/cli/cmd/user_new.go +++ b/cli/cmd/user_new.go @@ -4,7 +4,7 @@ import ( "bytes" "encoding/json" "fmt" - "io/ioutil" + "io" "log" "net/http" "os" @@ -41,9 +41,9 @@ var newCmd = &cobra.Command{ Short: "Create a new user", Long: ` The new command is used to create a new user - + Example: - okane user new + okane user new `, Run: func(cmd *cobra.Command, args []string) { // Getting user name @@ -113,7 +113,7 @@ Example: } defer resp.Body.Close() - body, err = ioutil.ReadAll(resp.Body) + body, err = io.ReadAll(resp.Body) if err != nil { log.Fatalf(err.Error()) } diff --git a/cli/cmd/user_update.go b/cli/cmd/user_update.go index ca02831..b57259e 100644 --- a/cli/cmd/user_update.go +++ b/cli/cmd/user_update.go @@ -4,7 +4,7 @@ import ( "bytes" "encoding/json" "fmt" - "io/ioutil" + "io" "log" "net/http" "os" @@ -32,9 +32,9 @@ var updateCmd = &cobra.Command{ Short: "Update user details", Long: ` The update command is used to update current login user details - + Example: - okane user update + okane user update `, Run: func(cmd *cobra.Command, args []string) { // Check if user is login @@ -96,7 +96,7 @@ Example: if err != nil { log.Fatalf(err.Error()) } - body, err = ioutil.ReadAll(res.Body) + body, err = io.ReadAll(res.Body) if err != nil { log.Fatalf(err.Error()) }