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:
Tobias Gesellchen
2026-01-09 23:21:33 +01:00
parent c656717262
commit 1729fa5d35
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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 {
+1 -1
View File
@@ -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 {