mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-12-05 16:07:33 +00:00
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:
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) })
|
||||
|
||||
|
||||
Reference in new issue
Block a user