On Tue, Aug 7, 2018 at 10:17 AM, Rohit Jain <jain.rohit.2...@gmail.com> 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 too large, WriteString will panic with ErrTooLarge.``` > > >`err is always nil` and it panics if the buffer is very large > > Can someone explain to me why do this method returns an error then?
So that it implements the (unexported) interface io.stringWriter. Ian -- 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 options, visit https://groups.google.com/d/optout.