In the strings module, there is a function func NewReader(s string) *Reader to create a Reader
from a string.
How can you get/read the string from the strings.Reader
?
In the strings module, there is a function func NewReader(s string) *Reader to create a Reader
from a string.
How can you get/read the string from the strings.Reader
?
You can use ioutil.ReadAll :
bytes, err := ioutil.ReadAll(r)
// err management here
s := string(bytes)