bytes.Buffer to string

24,579 views
Skip to first unread message

will

unread,
Feb 10, 2015, 12:44:16 AM2/10/15
to golan...@googlegroups.com
Hi there,

How do you convert bytes.Buffer to string in go?

Caleb Spare

unread,
Feb 10, 2015, 12:53:03 AM2/10/15
to will, golang-nuts
b.String()

http://golang.org/pkg/bytes/#Buffer.String

On Mon, Feb 9, 2015 at 9:44 PM, will <wma...@gmail.com> wrote:
> Hi there,
>
> How do you convert bytes.Buffer to string in go?
>
> --
> 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...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

will

unread,
Feb 10, 2015, 1:01:14 AM2/10/15
to golan...@googlegroups.com, wma...@gmail.com
Hi Caleb, it gives me

b.String undefined (type []byte has no field or method String)

will

unread,
Feb 10, 2015, 1:05:12 AM2/10/15
to golan...@googlegroups.com, wma...@gmail.com
Ok, it worked. Thanks. Sorry messed up code somewhere


On Tuesday, 10 February 2015 07:53:03 UTC+2, Caleb Spare wrote:
Reply all
Reply to author
Forward
0 new messages