fix(webicached): add --tags to git fetch and modernize Go string ops

Bug fix:
- gittag: git fetch without --tags misses tags not reachable from
  any branch, causing stale version lists.

Modern Go (Go 1.24+):
- strings.SplitSeq instead of strings.Split for iteration
- strings.Cut/CutPrefix/CutSuffix instead of Index/HasPrefix/TrimSuffix
- min() builtin instead of manual min logic

Fix:
- node_test: pass required baseURL argument to nodedist.Fetch
This commit is contained in:
AJ ONeal
2026-08-19 17:24:44 -06:00
parent 570c26dd11
commit 6fd248a4ac
16 changed files with 131 additions and 136 deletions
+2 -5
View File
@@ -34,7 +34,7 @@ func New() *http.Client {
TLSClientConfig: &tls.Config{
MinVersion: tls.VersionTLS12,
},
TLSHandshakeTimeout: 10 * time.Second,
TLSHandshakeTimeout: 10 * time.Second,
ResponseHeaderTimeout: 30 * time.Second,
MaxIdleConns: 100,
MaxIdleConnsPerHost: 10,
@@ -143,10 +143,7 @@ func backoff(attempt int, resp *http.Response) time.Duration {
}
// 1s, 2s, 4s base delays
base := time.Second << (attempt - 1)
if base > 30*time.Second {
base = 30 * time.Second
}
base := min(time.Second<<(attempt-1), 30*time.Second)
// Add jitter: 75% to 125% of base
jitter := float64(base) * (0.75 + 0.5*rand.Float64())