Skip to content

Commit

Permalink
chore: unexport UnexpectedTokenErr
Browse files Browse the repository at this point in the history
  • Loading branch information
ernado committed Nov 3, 2021
1 parent 8ad215b commit 2fc0351
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions dec_str.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@ func (v value) byte(b byte) value {
}
}

// UnexpectedTokenErr means that Token was unexpected while reading json.
type UnexpectedTokenErr struct {
// badTokenErr means that Token was unexpected while decoding.
type badTokenErr struct {
Token byte
}

func (e UnexpectedTokenErr) Error() string {
func (e badTokenErr) Error() string {
return fmt.Sprintf("unexpected byte %d '%s'", e.Token, []byte{e.Token})
}

func badToken(c byte) error {
return UnexpectedTokenErr{Token: c}
return badTokenErr{Token: c}
}

func (d *Decoder) str(v value) (value, error) {
Expand Down
2 changes: 1 addition & 1 deletion dec_str_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestDecoder_StrAppend(t *testing.T) {
}

func TestUnexpectedTokenErr_Error(t *testing.T) {
e := &UnexpectedTokenErr{
e := &badTokenErr{
Token: 'c',
}
s := error(e).Error()
Expand Down

0 comments on commit 2fc0351

Please sign in to comment.