On Tue, 10 Oct 2017, at 09:51 AM, aurelien.rain...@gmail.com wrote:
> 
> func main() {
> buf := bytes.NewBuffer(make([]byte, 4))
> buf.WriteString("1234")

These two lines result in a string with 4 null bytes followed by 1234.
Just use buf := &bytes.Buffer{}
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.

Reply via email to