Skip to content

Commit ad6b6e3

Browse files
committed
review: improve error messages
1 parent 83c68d6 commit ad6b6e3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/config/linters.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ func (l *Linters) validateAllDisableEnableOptions() error {
3838
}
3939

4040
if len(l.Disable) != 0 {
41-
return fmt.Errorf("can't combine options --disable-all and --disable %s", l.Disable[0])
41+
return errors.New("can't combine options --disable-all and --disable")
4242
}
4343
}
4444

4545
if l.EnableAll && len(l.Enable) != 0 && !l.Fast {
46-
return fmt.Errorf("can't combine options --enable-all and --enable %s", l.Enable[0])
46+
return errors.New("can't combine options --enable-all and --enable")
4747
}
4848

4949
return nil

pkg/config/linters_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ func TestLinters_validateAllDisableEnableOptions_error(t *testing.T) {
185185
DisableAll: true,
186186
Fast: false,
187187
},
188-
expected: "can't combine options --disable-all and --disable dupl",
188+
expected: "can't combine options --disable-all and --disable",
189189
},
190190
{
191191
desc: "enable-all and enable",
@@ -196,7 +196,7 @@ func TestLinters_validateAllDisableEnableOptions_error(t *testing.T) {
196196
DisableAll: false,
197197
Fast: false,
198198
},
199-
expected: "can't combine options --enable-all and --enable dupl",
199+
expected: "can't combine options --enable-all and --enable",
200200
},
201201
}
202202

0 commit comments

Comments
 (0)