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

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

asked Jan 30 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 by Eric Z Ma (41,910 points)

Please log in or register to answer this question.

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

...