Skip to content

Commit

Permalink
fix: linter
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-burghardt committed May 6, 2024
1 parent 2b55ae0 commit aa1c1aa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ var rootCmd = &cobra.Command{
Use: "wallet-backend",
Short: "Wallet Backend Server",
Run: func(cmd *cobra.Command, args []string) {
cmd.Help()
err := cmd.Help()
if err != nil {
log.Fatalf("Error calling help command: %s", err.Error())
}
},
}

Expand All @@ -22,7 +25,7 @@ var rootCmd = &cobra.Command{
func Execute() {
err := rootCmd.Execute()
if err != nil {
log.Fatal(err)
log.Fatalf("Error executing root command: %s", err.Error())
}
}

Expand Down
6 changes: 3 additions & 3 deletions internal/serve/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package serve

import (
"fmt"
"io/ioutil"
"io"
"net/http"
"net/http/httptest"
"testing"
Expand Down Expand Up @@ -36,7 +36,7 @@ func TestErrorResponseRender(t *testing.T) {
tc.in.Render(w)
resp := w.Result()
assert.Equal(t, tc.want.Status, resp.StatusCode)
body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
require.NoError(t, err)
assert.JSONEq(t, fmt.Sprintf(`{"error":%q}`, tc.want.Error), string(body))
})
Expand Down Expand Up @@ -69,7 +69,7 @@ func TestErrorHandler(t *testing.T) {
tc.in.ServeHTTP(w, r)
resp := w.Result()
assert.Equal(t, tc.want.Status, resp.StatusCode)
body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
require.NoError(t, err)
assert.JSONEq(t, fmt.Sprintf(`{"error":%q}`, tc.want.Error), string(body))
})
Expand Down

0 comments on commit aa1c1aa

Please sign in to comment.