• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tecnickcom / gogen / 28711809731
100%

Build:
DEFAULT BRANCH: main
Ran 04 Jul 2026 04:08PM UTC
Jobs 1
Files 165
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

04 Jul 2026 03:59PM UTC coverage: 99.967%. Remained the same
28711809731

push

github

nicolaasuni
feat(sfcache)!: typed generic cache with functional options, stale-if-error resilience, and correctness hardening

Significant improvements to pkg/sfcache, with matching updates to its consumers pkg/dnscache and pkg/awssecretcache.

API:
- Generic value type: Cache[K, V] and LookupFunc[K, V]; Lookup returns (V, error) with compile-time type safety, removing consumer type assertions, the typed-nil-boxing hazard, and the interface boxing allocation on stores.
- Functional options on New: WithTTLFunc computes per-entry TTLs from the key and value; WithStaleIfError serves the last known good value (bounded by maxStale past expiration) when a refresh fails, with automatic recovery on the first success.
- New exported API: ErrNilLookupFunc (a nil lookupFn installs a default failing function instead of panicking), ErrLookupAborted (context-ended waits, wraps the context error), and PurgeExpired.

Correctness fixes:
- Single-flight is preserved when an entry is removed mid-wait (Remove, Reset, or a panicking lookup): waiters re-evaluate cache state instead of spawning duplicate flights, and a stale flight can never clobber a successor's placeholder.
- TTLs use the monotonic clock (immune to NTP steps); extreme TTLs saturate instead of overflowing into an already-expired deadline.
- Capacity overshoot from concurrent distinct-key bursts is reclaimed (previously the map stayed pinned at the burst high-water mark forever), including on the stale-revive path.
- A panic on an unhashable key (possible with interface-typed keys) no longer leaks the read lock and wedges the cache.
- Producer context cancellation no longer poisons coalesced waiters, and only errors that actually are the producer's context error trigger the silent retry; genuine upstream errors are shared.
- The stale window takes precedence over the context-induced retry, so an upstream that hangs (every refresh dying by caller timeout) is still served stale; repeated failures cannot extend the origin... (continued)

213 of 213 new or added lines in 5 files covered. (100.0%)

12153 of 12157 relevant lines covered (99.97%)

103310.58 hits per line

Jobs
ID Job ID Ran Files Coverage
1 28711809731.1 04 Jul 2026 04:08PM UTC 165
99.97
GitHub Action Run
Source Files on build 28711809731
  • Tree
  • List 165
  • Changed 5
  • Source Changed 5
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #28711809731
  • b1bc6e7e on github
  • Prev Build on main (#28584293134)
  • Next Build on main (#28712211547)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc