Art9Studio / Aureole

Simplify error construction with fmt.Errorf SCC-S1028
Anti-pattern
Major
2 years ago2 years old
should use fmt.Errorf(...) instead of errors.New(fmt.Sprintf(...))
167func authorize(c *fiber.Ctx, app *app, user *User) error {
168	authz, ok := app.getIssuer()
169	if !ok {
170		return c.Status(http.StatusUnauthorized).JSON(ErrorBody(errors.New(fmt.Sprintf("app %s: cannot get issuer", app.name)), nil))171	}
172
173	payload, err := NewIssuerPayload(user.AsMap())