Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extending stream Decoder in encoding/json #12473

Closed
hsnamed opened this issue Sep 3, 2015 · 1 comment
Closed

Extending stream Decoder in encoding/json #12473

hsnamed opened this issue Sep 3, 2015 · 1 comment

Comments

@hsnamed
Copy link

hsnamed commented Sep 3, 2015

go version go1.5 linux/386
Debian 3.9.4-1 i686 GNU/Linux
package : encoding/json
file : stream.go

There is not enough public methods and public constants to control decode flow.
In other languages implementation of streaming processing json data is generaly based on constants token/event and methods : next() , hasNext(), getString() , getInt, getLong , getDecimal

I suggest extend and make public set of constants :

const (
    ObjectStart = iota
    ObjectEnd
    ArrayStart
    ArrayEnd
    KeyName
    ValueString
    ValueNumber
    ValueTrue
    ValueFalse
    ValueNull
)

and change method : func (dec *Decoder) Token() (Token, error) which must return only constant.

@minux
Copy link
Member

minux commented Sep 3, 2015 via email

@minux minux closed this as completed Sep 3, 2015
@golang golang locked and limited conversation to collaborators Sep 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants