Commit f12796e9 authored by Rob Pike's avatar Rob Pike

builtin: document appending a string to a byte slice

Fixes #4873.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7421043
parent abf5700a
...@@ -114,6 +114,8 @@ type ComplexType complex64 ...@@ -114,6 +114,8 @@ type ComplexType complex64
// result of append, often in the variable holding the slice itself: // result of append, often in the variable holding the slice itself:
// slice = append(slice, elem1, elem2) // slice = append(slice, elem1, elem2)
// slice = append(slice, anotherSlice...) // 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 func append(slice []Type, elems ...Type) []Type
// The copy built-in function copies elements from a source slice into a // The copy built-in function copies elements from a source slice into a
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment