wrapcheck icon indicating copy to clipboard operation
wrapcheck copied to clipboard

False-positive for anonymous functions

Open r2k1 opened this issue 3 years ago • 2 comments

Wrapcheck throws an error for the next case:

import "errors"

func Test_AnonFunc(t *testing.T) {
	test := func() error {
		return errors.New("test")
	}
	fmt.Println(test())
}

error returned from external package is unwrapped: sig: func errors.New(text string) error

r2k1 avatar Jul 28 '21 21:07 r2k1

Thanks for the report. Will have a look when I get some time.

tomarrell avatar Jul 29 '21 16:07 tomarrell

Bump on this. it is driving me a bit crazy.

hsommerlandreason avatar Mar 23 '23 14:03 hsommerlandreason