String returns the contents of the unread portion of the buffer as a string. If the Buffer is a nil pointer, it returns " ".
()
| 94 | // String returns the contents of the unread portion of the buffer |
| 95 | // as a string. If the Buffer is a nil pointer, it returns "<nil>". |
| 96 | func (b *Buffer) String() string { |
| 97 | if b == nil { |
| 98 | // Special case, useful in debugging. |
| 99 | return "<nil>" |
| 100 | } |
| 101 | return string(b.buf[b.off:]) |
| 102 | } |
| 103 | |
| 104 | // Len returns the number of bytes of the unread portion of the buffer; |
| 105 | // b.Len() == len(b.Bytes()). |
no outgoing calls