Skip to content

Commit 982731c

Browse files
committed
update FixedArray encode when FixedLength = 1
1 parent 660b5b7 commit 982731c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

types/FixedArray.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ func (f *FixedArray) TypeStructString() string {
4949

5050
func (f *FixedArray) Encode(value interface{}) string {
5151
var raw string
52+
if f.FixedLength == 1 {
53+
return EncodeWithOpt(f.SubType, value, &ScaleDecoderOption{Spec: f.Spec, Metadata: f.Metadata})
54+
}
5255
if reflect.TypeOf(value).Kind() == reflect.String && value.(string) == "" {
5356
return ""
5457
}

0 commit comments

Comments
 (0)