BrianLii commented on code in PR #3310:
URL: https://github.com/apache/fory/pull/3310#discussion_r2780462429
##########
go/fory/type_resolver.go:
##########
@@ -1751,6 +1763,10 @@ func (r *TypeResolver) createSerializer(type_
reflect.Type, mapInStruct bool) (s
if elem.Name() == "Float16" && (elem.PkgPath() ==
"github.com/apache/fory/go/fory/float16" || strings.HasSuffix(elem.PkgPath(),
"/float16")) {
return float16ArraySerializer{arrayType:
type_}, nil
}
+ // Check for fory.BFloat16 (aliased to uint16)
+ if elem == bfloat16Type {
Review Comment:
I used a direct type comparison, which is faster and more robust than
Name/PkgPath checks, since it’s just a pointer.
If this approach looks good, I can follow the same pattern for Float16 in a
separate PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]