code style: linting

This commit is contained in:
Marcin Mennemann
2026-05-24 09:52:02 +02:00
committed by Tobias Gesellchen
parent 65b142881a
commit 44ad0e5928
5 changed files with 6 additions and 0 deletions
+1
View File
@@ -20,6 +20,7 @@ func RadioBrowserSearch(query string) (*models.BmxNavResponse, error) {
if err != nil {
return nil, err
}
defer func() { _ = resp.Body.Close() }()
if resp.StatusCode != http.StatusOK {
+2
View File
@@ -1049,10 +1049,12 @@ func (s *Server) handleDiscoveredDevice(d models.DiscoveredDevice) {
if existing := s.findExistingDeviceInfoByDeviceID(deviceID); existing != nil {
storedAccount = existing.AccountID
}
accountID := liveInfo.MargeAccountUUID
if accountID == "" {
accountID = storedAccount
}
if accountID == "" {
accountID = "default"
}
@@ -114,6 +114,7 @@ func postSourcesUpdated(ds *datastore.DataStore, target Target) (string, error)
if err != nil {
return "", fmt.Errorf("post to speaker: %w", err)
}
defer func() { _ = resp.Body.Close() }()
if resp.StatusCode >= 300 {
@@ -132,6 +132,7 @@ func playDingOnDevice(ds *datastore.DataStore, serverURL string, target Target)
if err != nil {
return "", fmt.Errorf("post to speaker: %w", err)
}
defer func() { _ = resp.Body.Close() }()
if resp.StatusCode >= 300 {
+1
View File
@@ -63,6 +63,7 @@ func ProbeGet(ctx context.Context, rawURL string, timeout time.Duration) ProbeRe
result.Err = err.Error()
return result
}
defer func() { _ = resp.Body.Close() }()
body, err := io.ReadAll(io.LimitReader(resp.Body, 1<<20)) // 1 MiB cap