How to convert a byte[] to io.Reader in Go?

How to convert a byte[] to io.Reader in Go directly?

asked Jan 30, 2017 by anonymous

1 Answer

You can use the NewReader() func from the bytes package of Go to convert bytes to io.Reader.

For example,

reader := bytes.NewReader(thebytes)
answered Feb 12, 2017 by Eric Z Ma (44,200 points)

Please log in or register to answer this question.

Related questions

Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost

...