fix: resolve all lint errors and make linting a required CI check (#62)
- Fix 10 err113 violations: extract dynamic errors to package-level sentinels - Fix 12 errcheck violations: handle unchecked error returns in player, metadata, and config packages - Fix 4 revive stutter warnings: rename player.PlayerState to player.State, player.PlayerVolume to player.Volume, queue.QueueTrack to queue.Track, queue.QueueState to queue.State - Fix 2 staticcheck SA4001: simplify *&x to x in assets handler - Fix 5 unused constants: remove dead AudioFileType iota block in models - Fix gci/gofumpt/wsl formatting issues across multiple files - Add gofumpt module-path setting to .golangci.yml for correct import grouping - Fix player test: gate integration test behind YELLOWJACKET_INTEGRATION env var instead of only skipping in CI, and replace t.Errorf+t.Failed with t.Fatalf - Remove continue-on-error from golangci-lint CI step so linting is now required
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
"path"
|
||||
|
||||
"github.com/BurntSushi/toml"
|
||||
|
||||
"yellowjacket/backend/library"
|
||||
"yellowjacket/backend/system"
|
||||
)
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
|
||||
"github.com/gorilla/schema"
|
||||
"github.com/wailsapp/wails/v2/pkg/runtime"
|
||||
|
||||
"yellowjacket/backend/events"
|
||||
)
|
||||
|
||||
@@ -27,13 +28,20 @@ func (c *Config) handle(w http.ResponseWriter, r *http.Request) {
|
||||
case http.MethodPost:
|
||||
if err := c.handleConfigPost(r); err != nil {
|
||||
c.logger.Error("problem handling config post request", "err", err.Error())
|
||||
c.formSubmitError(err.Error()).Render(r.Context(), w)
|
||||
|
||||
if renderErr := c.formSubmitError(err.Error()).Render(r.Context(), w); renderErr != nil {
|
||||
c.logger.Error("problem rendering error response", "err", renderErr.Error())
|
||||
}
|
||||
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
c.formSubmitSuccess().Render(r.Context(), w)
|
||||
if err := c.formSubmitSuccess().Render(r.Context(), w); err != nil {
|
||||
c.logger.Error("problem rendering success response", "err", err.Error())
|
||||
}
|
||||
|
||||
w.WriteHeader(http.StatusOK)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user