How to convert a byte[] to io.Reader in Go directly?
You can use the NewReader()
func from the bytes
package of Go to convert bytes
to io.Reader
.
For example,
reader := bytes.NewReader(thebytes)
How to convert a byte[] to io.Reader in Go directly?
You can use the NewReader()
func from the bytes
package of Go to convert bytes
to io.Reader
.
For example,
reader := bytes.NewReader(thebytes)