Skip to content

Add github.com/cockroachdb/errors to hooks as alternative errors package#413

Open
ian-oneleet wants to merge 1 commit intouber-go:mainfrom
Oneleet:ian/hooks-cockroachdb-errors
Open

Add github.com/cockroachdb/errors to hooks as alternative errors package#413
ian-oneleet wants to merge 1 commit intouber-go:mainfrom
Oneleet:ian/hooks-cockroachdb-errors

Conversation

@ian-oneleet
Copy link
Copy Markdown

https://github.com/cockroachdb/errors is a popular alternative to the stdlib errors package. It provides alternative versions of errors.New, fmt.Errorf (which it calls errors.Newf), and errors.Join, among other functions.

Nilaway currently flags more false positives for codebases that use cockroachdb/errors instead of stdlib errors, because the built-in special cases for stdlib errors don't carry over to cockroachdb/errors. This PR duplicates the special cases in hook/assume_return.go and hook/replace_conditional.go so that they work with cockroachdb/errors.

Code was produced with LLM assistance (Claude).

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants