Skip to content

Commit

Permalink
feat(dec): remove Number
Browse files Browse the repository at this point in the history
  • Loading branch information
ernado committed Nov 5, 2021
1 parent 80786b3 commit e978d71
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
10 changes: 0 additions & 10 deletions dec_float.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package jx

import (
"bytes"
"encoding/json"
"io"
"math/big"
"strconv"
Expand Down Expand Up @@ -349,12 +348,3 @@ func validateFloat(str []byte) error {
}
return nil
}

// Number reads json.Number.
func (d *Decoder) Number() (json.Number, error) {
str, err := d.numberAppend(nil)
if err != nil {
return "", err
}
return json.Number(str), nil
}
8 changes: 0 additions & 8 deletions float_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ func Test_read_big_int(t *testing.T) {
should.Equal(`92233720368547758079223372036854775807`, val.String())
}

func Test_read_number(t *testing.T) {
should := require.New(t)
iter := DecodeStr(`92233720368547758079223372036854775807`)
val, err := iter.Number()
should.NoError(err)
should.Equal(`92233720368547758079223372036854775807`, string(val))
}

func Test_encode_inf(t *testing.T) {
should := require.New(t)
_, err := json.Marshal(math.Inf(1))
Expand Down

0 comments on commit e978d71

Please sign in to comment.