You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TestPanicErrorUnwrap does not test what it seems to test
- "wrappedErrorType" is always false (should be true in the second case)
- The values are already wrapped in the private error (they shouldn't)
- "errors.Is(err, new(T))" is undefined for zero-sized "T"s (and false for non-zero-sized).
- "tc := tc" is not needed since Go 1.22
Fixes:
- Use a (local) sentinel value instead of a type, as in TestDoErr.
- Replace all "new(errValue)" by direct references to the unique sentinel "errValue".
- Replace diagnostic, since the error type we get is internal, so we can't directly expect that - it should only wrap our sentinel.
Signed-off-by: Oliver Eikemeier <[email protected]>
0 commit comments