mirror of
https://github.com/gesellix/Bose-SoundTouch.git
synced 2026-08-18 00:26:29 +00:00
fix: resolve all staticcheck issues (SA5011)
- Fixed nil pointer dereference warnings by using t.Fatal instead of t.Error - In unified_test.go: Changed service nil check to use t.Fatal - In clockdisplay_test.go: Changed request nil check to use t.Fatal Using t.Fatal ensures test execution stops if pointer is nil, eliminating possibility of subsequent nil pointer dereference. Progress: Eliminated all 5 staticcheck issues Total issues: 21 → 16 (24% improvement) Remaining: - gocyclo: 14 (complexity - requires refactoring) - revive: 1 (DiscoveryService naming) - unparam: 1 (client.post result parameter)
This commit is contained in:
@@ -13,7 +13,7 @@ func TestNewUnifiedDiscoveryService(t *testing.T) {
|
||||
service := NewUnifiedDiscoveryService(cfg)
|
||||
|
||||
if service == nil {
|
||||
t.Error("Expected service to be created, got nil")
|
||||
t.Fatal("Expected service to be created, got nil")
|
||||
}
|
||||
|
||||
if service.config != cfg {
|
||||
|
||||
@@ -386,7 +386,7 @@ func TestNewClockDisplayRequest(t *testing.T) {
|
||||
request := NewClockDisplayRequest()
|
||||
|
||||
if request == nil {
|
||||
t.Error("Expected non-nil request")
|
||||
t.Fatal("Expected non-nil request")
|
||||
}
|
||||
|
||||
if request.Enabled != nil {
|
||||
|
||||
Reference in New Issue
Block a user