io - How to get a string from a Reader? -


in strings module, there function func newreader(s string) *reader create reader string.

how can get/read string strings.reader?

you can use ioutil.readall :

bytes, err := ioutil.readall(r) // err management here s := string(bytes) 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

IIS->Tomcat Redirect: multiple worker with default -