| Tim Windelschmidt | 1f4590b | 2025-07-29 23:05:36 +0200 | [diff] [blame^] | 1 | // Copyright 2021 The Cockroach Authors. |
| 2 | // SPDX-License-Identifier: Apache-2.0 |
| 3 | |
| 4 | package errwrap |
| 5 | |
| 6 | // ErrorFnFormatStringIndex contains functions that should be checked for |
| 7 | // improperly wrapped errors. The value is the index of the function |
| 8 | // parameter containing the format string. It is -1 if there is no format |
| 9 | // string parameter. |
| 10 | var ErrorFnFormatStringIndex = map[string]int{ |
| 11 | "errors.New": -1, |
| 12 | |
| 13 | "github.com/pkg/errors.New": -1, |
| 14 | "github.com/pkg/errors.Wrap": -1, |
| 15 | |
| 16 | "fmt.Errorf": 0, |
| 17 | |
| 18 | "github.com/pkg/errors.Errorf": 0, |
| 19 | "github.com/pkg/errors.Wrapf": 1, |
| 20 | } |