Skip to content

Commit 5317dfe

Browse files
authored
Add some additional linters (#250)
Both of these catch bugs, not style
1 parent d6dddb5 commit 5317dfe

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

.golangci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ linters:
6767
- 'ineffassign'
6868
- 'loggercheck'
6969
- 'makezero'
70+
- 'mirror'
7071
- 'misspell'
72+
- 'nilerr'
7173
- 'noctx'
7274
- 'nolintlint'
7375
- 'nosprintfhostport'

cli/flags_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ func ExampleFlagSet_AfterParse_checkIfError() {
531531
// Do not run this function if flag parsing or other AfterParse functions
532532
// have failed.
533533
if existingErr != nil {
534-
return nil
534+
return nil //nolint:nilerr
535535
}
536536

537537
// Logic

renderer/funcs.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func toStringSlice(i any) ([]string, error) {
125125
func joinStrings(i any, sep string) (string, error) {
126126
l, err := toStringSlice(i)
127127
if err != nil {
128-
return "", nil
128+
return "", err
129129
}
130130
return strings.Join(l, sep), nil
131131
}
@@ -134,7 +134,7 @@ func joinStrings(i any, sep string) (string, error) {
134134
func toSentence(i any, joiner string) (string, error) {
135135
l, err := toStringSlice(i)
136136
if err != nil {
137-
return "", nil
137+
return "", err
138138
}
139139

140140
switch len(l) {

0 commit comments

Comments
 (0)