From: Rob Pike Date: Thu, 28 Feb 2013 00:11:17 +0000 (-0800) Subject: builtin: document appending a string to a byte slice X-Git-Tag: go1.1rc2~795 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=f12796e9f7233266163d4003b528dd099b0f1799;p=gostls13.git builtin: document appending a string to a byte slice Fixes #4873. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/7421043 --- diff --git a/src/pkg/builtin/builtin.go b/src/pkg/builtin/builtin.go index 91d263a623..7b5e9ab1d6 100644 --- a/src/pkg/builtin/builtin.go +++ b/src/pkg/builtin/builtin.go @@ -114,6 +114,8 @@ type ComplexType complex64 // result of append, often in the variable holding the slice itself: // slice = append(slice, elem1, elem2) // slice = append(slice, anotherSlice...) +// As a special case, it is legal to append a string to a byte slice, like this: +// slice = append([]byte("hello "), "world"...) func append(slice []Type, elems ...Type) []Type // The copy built-in function copies elements from a source slice into a