wrapcheck icon indicating copy to clipboard operation
wrapcheck copied to clipboard

A Go linter to check that errors from external packages are wrapped

Results 10 wrapcheck issues
Sort by recently updated
recently updated
newest added

Gorm uses non-standard error format to support it's chainable API. It would be nice if there was a way to configure wrapcheck to match a `*.\.Error` regex ```go tx :=...

When an interface is embedded, the reported interface name isn't what you need to ignore. Concretely, extend `wrapcheck/testdata/config_ignoreInterfaceRegexps/main.go` with the following, and run the test. ```go type embedder interface {...

I found several cases in my codebase (https://github.com/kopia/kopia/pull/747) that follow the following buggy pattern: ```golang err := doSomething() if err != nil { return result, errors.Wrap(err, "something failed") } if...

enhancement

As has been requested, ignoring the main module in a project via a flag to prevent having to configure the package ignore for each project. Something along the lines of...

enhancement

Wrapcheck throws an error for the next case: ```go import "errors" func Test_AnonFunc(t *testing.T) { test := func() error { return errors.New("test") } fmt.Println(test()) } ``` `error returned from external...

bug

Try this out ```go package main import ( "errors" ) func somethingDangerous() error { return errors.New("fake err") } func run() (err error) { err = somethingDangerous() return } func main()...

bug

Hey, great tool! This has been really useful to track down places I can apply some new error context packages I've been working on to provide additional structured information to...

First, thank you so much for this great linter. It's already brought me so much sanity, like a lost desert wanderer coming across an oasis 🏝️! It seems that this...

I have a utility function like this: ```go type Slice[T any] []T func (slice Slice[T]) TryForEach(message string, fn func(T) error) error { for _, item := range slice { if...

When an interface method is not exported, its implementation can be assumed to wrap errors. This can be implemented by requiring `sel.Sel.IsExported()` before checking for `isInterface(pass, sel)`. Then e.g., the...