Skip to content

Commit b57ed2a

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

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
with:
2020
go-version: 1.21
2121

22-
- uses: actions/cache@v2
22+
- uses: actions/cache@v4
2323
with:
2424
path: ~/go/pkg/mod
2525
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}

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)