Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions go/fory/type_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ func newTypeResolver(fory *Fory) *TypeResolver {
for _, t := range []reflect.Type{
boolType,
byteType,
uint16Type,
uint32Type,
uint64Type,
int8Type,
int16Type,
int32Type,
Expand Down Expand Up @@ -1704,6 +1707,12 @@ func (r *TypeResolver) createSerializer(type_ reflect.Type, mapInStruct bool) (s
case reflect.Uint8:
// []byte uses byteSliceSerializer
return byteSliceSerializer{}, nil
case reflect.Uint16:
return uint16SliceSerializer{}, nil
case reflect.Uint32:
return uint32SliceSerializer{}, nil
case reflect.Uint64:
return uint64SliceSerializer{}, nil
case reflect.String:
return stringSliceSerializer{}, nil
}
Expand Down
3 changes: 3 additions & 0 deletions go/fory/type_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ func TestTypeResolver(t *testing.T) {
"[]map[string][]map[string]*interface {}"},
{reflect.TypeOf((*A)(nil)), "*@example.A"},
{reflect.TypeOf((*A)(nil)).Elem(), "@example.A"},
{reflect.TypeOf([]uint16{}), "[]uint16"},
Copy link
Collaborator

@chaokunyang chaokunyang Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also add a serialization test in go/fory/slice_primitive_test.go ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be happy to. I'll add the tests for int/uint slice in a seperate PR.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add the tests in this PR? The fix should have coresponing tests in same PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review. Because this PR only fixes the type_resolver, shouldn't the tests in go/fory/type_test.go be enough? I can also include the test for int8, int16, int32, int64 in type_test.go

{reflect.TypeOf([]uint32{}), "[]uint32"},
{reflect.TypeOf([]uint64{}), "[]uint64"},
{reflect.TypeOf((*[]map[string]int)(nil)), "*[]map[string]int"},
{reflect.TypeOf((*[]map[A]int)(nil)), "*[]map[@example.A]int"},
{reflect.TypeOf((*[]map[string]*A)(nil)), "*[]map[string]*@example.A"},
Expand Down
Loading