Go Package bytes: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 12: | Line 12: | ||
A <tt>Buffer</tt> does not have to be initialized and supports both <tt>[[Go_Package_io#Reader|Reader]]</tt> and <tt>[[Go_Package_io#Writer|Writer]]</tt> interface. | A <tt>Buffer</tt> does not have to be initialized and supports both <tt>[[Go_Package_io#Reader|Reader]]</tt> and <tt>[[Go_Package_io#Writer|Writer]]</tt> interface. | ||
Conversion of a <tt>Buffer</tt> into a <tt>[]byte</tt>: | |||
<pre> | |||
var buffer bytes.Buffer | |||
bytes := buffer.Bytes[] | |||
</pre> |