Re: [go-nuts] buffer.WriteString Error case

2018-08-07 Thread Sam Whited
On Tue, Aug 7, 2018, at 19:43, Ian Lance Taylor wrote: > So that it implements the (unexported) interface io.stringWriter. I've wondered about this for a while; I find myself creating a StringWriter interface frequently in various projects. With all the other great standard interfaces in the io

[go-nuts] buffer.WriteString Error case

2018-08-07 Thread Dave Cheney
So that it can be used interchangeably with *bufio.Writer. -- 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. For more opt

Re: [go-nuts] buffer.WriteString Error case

2018-08-07 Thread Ian Lance Taylor
On Tue, Aug 7, 2018 at 10:17 AM, Rohit Jain wrote: > > I Just happened to look at below comment on *WriteString* > > ```// WriteString appends the contents of s to the buffer, growing the buffer > as > // needed. The return value n is the length of s; err is always nil. If the > // buffer becomes

[go-nuts] buffer.WriteString Error case

2018-08-07 Thread Rohit Jain
I Just happened to look at below comment on *WriteString* ```// WriteString appends the contents of s to the buffer, growing the buffer as // needed. The return value n is the length of s; err is always nil. If the // buffer becomes too large, WriteString will panic with ErrTooLarge.``` >`err is