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

Streaming decoder #4

Closed
beatgammit opened this issue Mar 22, 2014 · 5 comments
Closed

Streaming decoder #4

beatgammit opened this issue Mar 22, 2014 · 5 comments

Comments

@beatgammit
Copy link

It would be nice to have a Decoder.Decode like encoding/json for processing streams. I basically want to do:

f, _ := os.Open(filename)
yaml.NewDecoder(f).Decode(&obj)

Instead of:

b, _ := ioutil.ReadFile(filename)
yaml.Unmarshal(b, &obj)

This makes it nicer for decoding yaml documents from io.Readers without having to read everything into a []byte first.

@niemeyer
Copy link
Contributor

This should also consider streams with multiple documents.

@james-lawrence
Copy link

+1

@at15
Copy link

at15 commented Jan 8, 2017

There is a PR #163 for this issue, but got stuck on CLA

@im-kulikov
Copy link

#288 Workaround Encoder/Decoder

@rogpeppe
Copy link
Contributor

rogpeppe commented Jan 7, 2018

Fixed by #301

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants