3 // Copyright 2022 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
9 func add[S ~string | ~[]byte](buf *[]byte, s S) {
10 *buf = append(*buf, s...)
16 add(&buf, []byte("bar"))
17 if string(buf) != "foobar" {
18 panic("got " + string(buf))