build/analysis: copy cockroachdb code to third_party
We are currently fetching the full cockroach repository just for a hand
full of nogo passes. As the version we use is licensed under Apache 2.0,
we can copy them to third_party, allowing us to modify them and keep them
stable.
Change-Id: Ia28b181296138eef922485b6517d1e0066766715
Reviewed-on: https://review.monogon.dev/c/monogon/+/4486
Reviewed-by: Leopold Schabel <leo@monogon.tech>
Tested-by: Jenkins CI
diff --git a/third_party/com_github_cockroachdb_cockroach/errwrap/functions.go b/third_party/com_github_cockroachdb_cockroach/errwrap/functions.go
new file mode 100644
index 0000000..e482578
--- /dev/null
+++ b/third_party/com_github_cockroachdb_cockroach/errwrap/functions.go
@@ -0,0 +1,20 @@
+// Copyright 2021 The Cockroach Authors.
+// SPDX-License-Identifier: Apache-2.0
+
+package errwrap
+
+// ErrorFnFormatStringIndex contains functions that should be checked for
+// improperly wrapped errors. The value is the index of the function
+// parameter containing the format string. It is -1 if there is no format
+// string parameter.
+var ErrorFnFormatStringIndex = map[string]int{
+ "errors.New": -1,
+
+ "github.com/pkg/errors.New": -1,
+ "github.com/pkg/errors.Wrap": -1,
+
+ "fmt.Errorf": 0,
+
+ "github.com/pkg/errors.Errorf": 0,
+ "github.com/pkg/errors.Wrapf": 1,
+}