Skip to content

Commit 54617c0

Browse files
committed
Fix all remaining errcheck warnings
- pkg/compression/compression.go: Add explicit error ignoring for cleanup paths - examples/metrics/main.go: Add error handling for cache.Set operations - internal/store/redis/redis_test.go: Add explicit error ignoring for test cleanup This resolves all remaining golangci-lint errcheck warnings.
1 parent 01fd316 commit 54617c0

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

examples/metrics/main.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,13 @@ func opentelemetryExample() {
188188

189189
// Set some values
190190
for i := 1; i <= 5; i++ {
191-
cache.Set(fmt.Sprintf("product:%d", i), map[string]any{
191+
if err := cache.Set(fmt.Sprintf("product:%d", i), map[string]any{
192192
"id": i,
193193
"name": fmt.Sprintf("Product %d", i),
194194
"price": float64(i) * 10.99,
195-
}, time.Hour)
195+
}, time.Hour); err != nil {
196+
log.Printf("Error setting cache: %v", err)
197+
}
196198
}
197199

198200
// Get some values (mix of hits and misses)
@@ -270,7 +272,9 @@ func multiExporterExample() {
270272

271273
// Set every 4th item
272274
if i%4 == 0 {
273-
cache.Set(key, value, 30*time.Second)
275+
if err := cache.Set(key, value, 30*time.Second); err != nil {
276+
log.Printf("Error setting cache: %v", err)
277+
}
274278
}
275279

276280
// Try to get every item

0 commit comments

Comments
 (0)