mirror of
https://github.com/navidrome/navidrome.git
synced 2026-05-03 06:51:16 +00:00
chore(lint): upgrade golangci-lint, fix/ignore new errors
Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
parent
94eb6c522b
commit
556f345a10
2
Makefile
2
Makefile
@ -20,7 +20,7 @@ IMAGE_PLATFORMS ?= $(shell echo $(SUPPORTED_PLATFORMS) | tr ',' '\n' | grep "lin
|
|||||||
PLATFORMS ?= $(SUPPORTED_PLATFORMS)
|
PLATFORMS ?= $(SUPPORTED_PLATFORMS)
|
||||||
DOCKER_TAG ?= deluan/navidrome:develop
|
DOCKER_TAG ?= deluan/navidrome:develop
|
||||||
|
|
||||||
GOLANGCI_LINT_VERSION ?= v2.11.1
|
GOLANGCI_LINT_VERSION ?= v2.12.0
|
||||||
|
|
||||||
UI_SRC_FILES := $(shell find ui -type f -not -path "ui/build/*" -not -path "ui/node_modules/*")
|
UI_SRC_FILES := $(shell find ui -type f -not -path "ui/build/*" -not -path "ui/node_modules/*")
|
||||||
|
|
||||||
|
|||||||
@ -156,7 +156,7 @@ var _ = Describe("sendResponse", func() {
|
|||||||
It("updates status pointer when an error occurs", func() {
|
It("updates status pointer when an error occurs", func() {
|
||||||
pointer := int32(0)
|
pointer := int32(0)
|
||||||
|
|
||||||
ctx := context.WithValue(r.Context(), subsonicErrorPointer, &pointer)
|
ctx := context.WithValue(r.Context(), subsonicErrorPointer, &pointer) //nolint:govet
|
||||||
r = r.WithContext(ctx)
|
r = r.WithContext(ctx)
|
||||||
|
|
||||||
payload.Status = responses.StatusFailed
|
payload.Status = responses.StatusFailed
|
||||||
|
|||||||
@ -37,7 +37,7 @@ func (api *Router) GetAvatar(w http.ResponseWriter, r *http.Request) (*responses
|
|||||||
log.Warn(ctx, "User needs an email for gravatar to work", "username", username)
|
log.Warn(ctx, "User needs an email for gravatar to work", "username", username)
|
||||||
return api.getPlaceHolderAvatar(w, r)
|
return api.getPlaceHolderAvatar(w, r)
|
||||||
}
|
}
|
||||||
http.Redirect(w, r, gravatar.Url(u.Email, 0), http.StatusFound)
|
http.Redirect(w, r, gravatar.Url(u.Email, 0), http.StatusFound) //nolint:gosec // URL is not constructed from user input
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -199,7 +199,7 @@ func getPlayer(players core.Players) func(next http.Handler) http.Handler {
|
|||||||
}
|
}
|
||||||
r = r.WithContext(ctx)
|
r = r.WithContext(ctx)
|
||||||
|
|
||||||
cookie := &http.Cookie{
|
cookie := &http.Cookie{ //nolint:gosec // Secure omitted: Navidrome may run over plain HTTP
|
||||||
Name: playerIDCookieName(userName),
|
Name: playerIDCookieName(userName),
|
||||||
Value: player.ID,
|
Value: player.ID,
|
||||||
MaxAge: consts.CookieExpiry,
|
MaxAge: consts.CookieExpiry,
|
||||||
@ -239,7 +239,9 @@ func playerIDCookieName(userName string) string {
|
|||||||
return cookieName
|
return cookieName
|
||||||
}
|
}
|
||||||
|
|
||||||
const subsonicErrorPointer = "subsonicErrorPointer"
|
type contextKey string
|
||||||
|
|
||||||
|
const subsonicErrorPointer contextKey = "subsonicErrorPointer"
|
||||||
|
|
||||||
func recordStats(metrics metrics.Metrics) func(next http.Handler) http.Handler {
|
func recordStats(metrics metrics.Metrics) func(next http.Handler) http.Handler {
|
||||||
return func(next http.Handler) http.Handler {
|
return func(next http.Handler) http.Handler {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user