File tree Expand file tree Collapse file tree 4 files changed +371
-164
lines changed Expand file tree Collapse file tree 4 files changed +371
-164
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,12 @@ go-errorlint -fix ./...
30
30
```
31
31
32
32
The tool can automatically fix:
33
+
34
+ > [ !CAUTION]
35
+ > These fixes are still under development and the behavior is not yet stable.
36
+ > It is possible that it will make mistakes and cause more harm than good.
37
+ > Use with caution.
38
+
33
39
1 . Non-wrapping format verb for fmt.Errorf (changing ` %v ` to ` %w ` )
34
40
2 . Direct error comparisons (replacing ` err == ErrFoo ` with ` errors.Is(err, ErrFoo) ` )
35
41
3 . Type assertions on errors (replacing ` err.(*MyError) ` with ` errors.As ` usage)
@@ -82,6 +88,8 @@ Errors returned from standard library functions that explicitly document that
82
88
an unwrapped error is returned are allowed by the linter. Notable cases are
83
89
` io.EOF ` and ` sql.ErrNoRows ` .
84
90
91
+ You can pass ` -fix ` to have go-errorlint automatically fix these issues for you.
92
+
85
93
** Caveats** :
86
94
* Comparing the error returned from ` (io.Reader).Read ` to ` io.EOF ` without
87
95
` errors.Is ` is considered valid as this is
@@ -107,6 +115,8 @@ var me MyError
107
115
ok := errors.As (err, &me)
108
116
```
109
117
118
+ You can pass ` -fix ` to have go-errorlint automatically fix these issues for you.
119
+
110
120
## Contributing
111
121
112
122
Do you think you have found a bug? Then please report it via the Github issue tracker. Make sure to
You can’t perform that action at this time.
0 commit comments