| 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 unusedresult defines an analyzer that checks for unused |
| 6 | // results of calls to certain pure functions. |
| 7 | // |
| 8 | // # Analyzer unusedresult |
| 9 | // |
| 10 | // unusedresult: check for unused results of calls to some functions |
| 11 | // |
| 12 | // Some functions like fmt.Errorf return a result and have no side |
| 13 | // effects, so it is always a mistake to discard the result. Other |
| 14 | // functions may return an error that must not be ignored, or a cleanup |
| 15 | // operation that must be called. This analyzer reports calls to |
| 16 | // functions like these when the result of the call is ignored. |
| 17 | // |
| 18 | // The set of functions may be controlled using flags. |
| 19 | package unusedresult |