1 // errorcheck -0 -d=append
3 // Copyright 2015 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.
7 // Check optimization results for append.
11 func a1(x []int, y int) []int {
12 x = append(x, y) // ERROR "append: len-only update"
16 func a2(x []int, y int) []int {
17 return append(x, y) // ERROR "append: full update"
20 func a3(x *[]int, y int) {
21 *x = append(*x, y) // ERROR "append: len-only update"