From 95ff1323d50b443576a221f576d326e429b73f6c Mon Sep 17 00:00:00 2001 From: Lyes Date: Tue, 16 Jan 2024 12:24:59 +0100 Subject: [PATCH] Revert "fix : noneprefixer did not return correct fixed len" This reverts commit 69ff60480416e2bddc88be3e9c354d904c25a1f7. --- field/numeric.go | 2 +- field/numeric_test.go | 2 +- prefix/none.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/field/numeric.go b/field/numeric.go index e4ebc8eb..1c0f8541 100644 --- a/field/numeric.go +++ b/field/numeric.go @@ -185,7 +185,7 @@ func (f *Numeric) Marshal(v any) error { } f.value = val default: - return fmt.Errorf("data does not match require *Numeric or (int64, *int64, string, *string) type") + return fmt.Errorf("data does not match require *Numeric or (int, *int, string, *string) type") } return nil diff --git a/field/numeric_test.go b/field/numeric_test.go index 82679257..090b0399 100644 --- a/field/numeric_test.go +++ b/field/numeric_test.go @@ -160,7 +160,7 @@ func TestNumericFieldMarshal(t *testing.T) { err = numericField.Marshal([]byte("123456")) require.Error(t, err) - require.Equal(t, "data does not match require *Numeric or (int64, *int64, string, *string) type", err.Error()) + require.Equal(t, "data does not match require *Numeric or (int, *int, string, *string) type", err.Error()) } func TestNumericFieldWithNotANumber(t *testing.T) { diff --git a/prefix/none.go b/prefix/none.go index df88379b..0b220eca 100644 --- a/prefix/none.go +++ b/prefix/none.go @@ -12,7 +12,7 @@ func (p *nonePrefixer) EncodeLength(int, int) ([]byte, error) { } func (p *nonePrefixer) DecodeLength(fixLen int, data []byte) (int, int, error) { - return fixLen, 0, nil + return len(data), 0, nil } func (p *nonePrefixer) Inspect() string {