| 1 | // Copyright 2023 The Go Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | // Package appends defines an Analyzer that detects |
| 6 | // if there is only one variable in append. |
| 7 | // |
| 8 | // # Analyzer appends |
| 9 | // |
| 10 | // appends: check for missing values after append |
| 11 | // |
| 12 | // This checker reports calls to append that pass |
| 13 | // no values to be appended to the slice. |
| 14 | // |
| 15 | // s := []string{"a", "b", "c"} |
| 16 | // _ = append(s) |
| 17 | // |
| 18 | // Such calls are always no-ops and often indicate an |
| 19 | // underlying mistake. |
| 20 | package appends |