The GitHub Actions job "Fory CI" on fory.git/main has succeeded.
Run started by GitHub user chaokunyang (triggered by chaokunyang).

Head commit for run:
ddf06621410674532440a87b278e726ad3bdc492 / Ayush Kumar 
<[email protected]>
fix(go): return nil serializer on getTypeInfo err (#3719)

## Why?



## What does this PR do?



## Related issues
Closes #3718 

## AI Contribution Checklist
Issue was flagged by claude
```
Confirmed bug

1. type_resolver.go:1018 — serializer-creation error is silently swallowed

Confidence: high (confirmed by go vet and by reading the code). Severity: 
medium–high.

serializer, err := r.createSerializer(value.Type(), false)
if err != nil {
    fmt.Errorf("failed to create serializer: %w", err)   // <-- result discarded
}
info.Serializer = serializer        // serializer is nil here on error
// ...
r.typePointerCache[typePtr] = info  // nil serializer gets cached
return info, nil                    // returns nil error despite failure

The error is built with fmt.Errorf but never returned or assigned. On the 
lazy-init path, when createSerializer fails, serializer is nil, that nil is 
stored into info.Serializer, cached, and the function returns (info, nil) — 
pretending success. A later serialize/deserialize then uses a nil serializer → 
wrong behavior or a nil-deref panic, far from the real cause.

Fix: return nil, fmt.Errorf("failed to create serializer: %w", err)

go vet flags this directly:
type_resolver.go:1018:5: result of fmt.Errorf call not used
```


## Does this PR introduce any user-facing change?



- [ ] Does this PR introduce any public API change?
- [ ] Does this PR introduce any binary protocol compatibility change?

## Benchmark

Report URL: https://github.com/apache/fory/actions/runs/26683664890

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to