fix: resolve whitespace (wsl_v5) issues - part 1

- Fix whitespace issues in cmd files (example-mdns, example-upnp, soundtouch-cli, websocket-demo)
- Fix whitespace issues in client.go and websocket.go
- Fix whitespace issues in test files
- Restore accidentally removed deviceHost variable
- Add proper spacing around loops, conditionals, and function calls

Progress: Continuing to resolve remaining wsl_v5 linting issues
This commit is contained in:
Tobias Gesellchen
2026-01-09 23:07:32 +01:00
parent 9ed8182278
commit 8d047bec78
9 changed files with 41 additions and 3 deletions
+2
View File
@@ -351,6 +351,7 @@ func TestClient_IncreaseBalance(t *testing.T) {
w.WriteHeader(http.StatusOK)
}
}))
defer server.Close()
config := &Config{
@@ -438,6 +439,7 @@ func TestClient_DecreaseBalance(t *testing.T) {
w.WriteHeader(http.StatusOK)
}
}))
defer server.Close()
config := &Config{
+2
View File
@@ -366,6 +366,7 @@ func BenchmarkClient_Bass_Integration(b *testing.B) {
b.Run("GetBass", func(b *testing.B) {
b.ResetTimer()
for i := 0; i < b.N; i++ {
_, err := client.GetBass()
if err != nil {
@@ -377,6 +378,7 @@ func BenchmarkClient_Bass_Integration(b *testing.B) {
b.Run("SetBass", func(b *testing.B) {
bassLevels := []int{-3, 0, 3, -1, 1} // Cycle through different levels
b.ResetTimer()
for i := 0; i < b.N; i++ {
level := bassLevels[i%len(bassLevels)]
err := client.SetBass(level)
+3
View File
@@ -248,6 +248,7 @@ func (c *Client) VolumeDown() error {
// SelectPreset sends a preset key command (1-6)
func (c *Client) SelectPreset(presetNumber int) error {
var keyValue string
switch presetNumber {
case 1:
keyValue = models.KeyPreset1
@@ -648,6 +649,7 @@ func (c *Client) get(endpoint string, result interface{}) error {
if err != nil {
return fmt.Errorf("failed to execute request: %w", err)
}
defer func() {
if closeErr := resp.Body.Close(); closeErr != nil {
// Log the error but don't override the main error
@@ -704,6 +706,7 @@ func (c *Client) post(endpoint string, payload, result interface{}) error {
if err != nil {
return fmt.Errorf("failed to execute request: %w", err)
}
defer func() {
if closeErr := resp.Body.Close(); closeErr != nil {
// Log the error but don't override the main error
+1
View File
@@ -362,6 +362,7 @@ func (ws *WebSocketClient) handleEvent(event *models.WebSocketEvent) {
for _, eventType := range eventTypes {
hasKnownEvent = true
switch eventType {
case models.EventTypeNowPlaying:
if handlers.OnNowPlaying != nil && event.NowPlayingUpdated != nil {