Fix linter errors
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing

This commit is contained in:
2022-08-21 19:49:16 +00:00
parent 08fbacc7e6
commit c2f9ef8ec7
4 changed files with 18 additions and 4 deletions

View File

@ -1,6 +1,7 @@
package server
import (
"context"
"encoding/json"
"net/http"
"net/http/httptest"
@ -35,11 +36,10 @@ func TestRegisterUser(t *testing.T) {
t.Run("RegisterUser", func(t *testing.T) {
t.Parallel()
request, err := http.NewRequest(
request, err := http.NewRequestWithContext(context.Background(),
http.MethodPost,
"/api/v1/user/register",
strings.NewReader(`{"password":"pass","email":"info@example.com","name":"Test"}`))
request.Header.Set("Content-Type", "application/json")
context := engine.NewContext(request, recorder)
if err != nil {
t.Errorf("error creating request: %s", err)

View File

@ -41,7 +41,7 @@ func (h *Handler) budgetingForMonth(c echo.Context) error {
month, err := getDate(c)
if err != nil {
c.Redirect(http.StatusTemporaryRedirect, "/budget/"+budget.ID.String())
return c.Redirect(http.StatusTemporaryRedirect, "/budget/"+budget.ID.String())
}
data, err := h.getBudgetingViewForMonth(c.Request().Context(), budget, month)

View File

@ -35,7 +35,7 @@ func (h *Handler) verifyLogin(c echo.Context) (budgeteer.Token, error) { //nolin
tokenString = tokenString[7:]
token, err := h.TokenVerifier.VerifyToken(tokenString)
if err != nil {
return nil, fmt.Errorf("verify token '%s': %s", tokenString, err)
return nil, fmt.Errorf("verify token '%s': %w", tokenString, err)
}
return token, nil