Add code linting to build #13

Merged
jacob1123 merged 57 commits from linting into master 2022-02-20 23:53:48 +01:00
3 changed files with 5 additions and 4 deletions
Showing only changes of commit 72b5bdde4f - Show all commits

View File

@ -30,12 +30,12 @@ func main() {
panic("couldn't open static files")
}
h := &http.Handler{
handler := &http.Handler{
Service: q,
TokenVerifier: &jwt.TokenVerifier{},
CredentialsVerifier: &bcrypt.Verifier{},
StaticFS: netHttp.FS(static),
}
h.Serve()
handler.Serve()
}

View File

@ -73,7 +73,7 @@ func (h *Handler) loginPost(c *gin.Context) {
return
}
t, err := h.TokenVerifier.CreateToken(&user)
token, err := h.TokenVerifier.CreateToken(&user)
if err != nil {
c.AbortWithError(http.StatusUnauthorized, err)
}
@ -85,7 +85,7 @@ func (h *Handler) loginPost(c *gin.Context) {
return
}
c.JSON(http.StatusOK, LoginResponse{t, user, budgets})
c.JSON(http.StatusOK, LoginResponse{token, user, budgets})
}
type LoginResponse struct {

View File

@ -72,6 +72,7 @@ func (n Numeric) Sub(o Numeric) Numeric {
panic("Cannot subtract with different exponents")
}
func (n Numeric) Add(o Numeric) Numeric {
left := n
right := o