I have an io.ReadCloser object (from an http.Response object).
io.ReadCloser
http.Response
What\'s the most efficient way to convert the entire stream to a strin
strin
func copyToString(r io.Reader) (res string, err error) { var sb strings.Builder if _, err = io.Copy(&sb, r); err == nil { res = sb.String() } return }