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
feat: Add automatic error comparison and type assertion fixes (#96)
Signed-off-by: Kemal Akkoyun <[email protected]>
Co-authored-by: ccoVeille <[email protected]>
Enhance errorlint analyzer with automatic fixes for:
- Error comparisons using `==` and `!=`
- Type assertions on errors
- Error switches
Adds suggested fixes to:
- Replace direct error comparisons with `errors.Is()`
- Convert type assertions to use `errors.As()`
- Transform error switches to use `errors.Is()` and `errors.As()`
Includes new test cases and golden files to validate the new automatic fixing capabilities.
* feat: Improve errorlint with better variable naming and error handling
- Add function for meaningful error variable names
- Preserve original "ok" variable names in type assertions
- Use errors.As() with generated variable names
- Add tests for custom and wrapped errors
0 commit comments