fix: use checked type assertion to pass errcheck lint

The golangci-lint CI job fails because check-type-assertions is enabled
and version.Load().(string) uses the unchecked single-value form.
Switch to the two-value form so the linter is satisfied.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
一叶飘零andClaude Opus 4.6 committed 2026-11-30 01:47:41 +08:00
1 parent cc08bc0f17
commit 2eb3170504
1 file changed
+5 -1
@@ -127,7 +127,11 @@ func TestGatewayRoutesAutomaticCodexCatalogTracksCanonicalIdentity(t *testing.T)
var version atomic.Value
version.Store("0.200.0")
service.SetCodexCanonicalUserAgentResolver(func() string {
return "codex_cli_rs/" + version.Load().(string) + " (Linux; x86_64) test"
v, ok := version.Load().(string)
if !ok {
return ""
}
return "codex_cli_rs/" + v + " (Linux; x86_64) test"
})
t.Cleanup(func() { service.SetCodexCanonicalUserAgentResolver(nil) })