Use io.Copy <https://pkg.go.dev/io#Copy>. Example: https://play.golang.org/p/89KkmplfZ4M
-Ross On Thursday, October 7, 2021 at 5:13:17 AM UTC-7 RS wrote: > How can I copy resp.Body to a *bytes.Buffer? > > I am new to go. > resp.Body is the response which I get from client.Do, and is of type > *http.Response -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/1f10a859-c77f-4f66-95ba-f799fd0addd0n%40googlegroups.com.