Skip to content

Commit

Permalink
Revert "fix : noneprefixer did not return correct fixed len"
Browse files Browse the repository at this point in the history
This reverts commit 69ff604.
  • Loading branch information
Lyes committed Jan 16, 2024
1 parent 69ff604 commit 95ff132
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion field/numeric.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion field/numeric_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion prefix/none.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 95ff132

Please sign in to comment.