Skip to content

Commit eee1454

Browse files
authored
fix: Disable unparam linter due to Go generics panic (#199)
The unparam linter panics when analyzing code that uses Go generics with type constraints (e.g., ~string). This is a known upstream issue in the underlying Go types package. Workaround: Disable unparam globally and rely on revive's unused-parameter rule for similar coverage. See: golangci/golangci-lint#5254 Co-authored-by: Ben Coombs <[email protected]>
1 parent 699356a commit eee1454

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.golangci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ linters:
2525
- goconst # Repeated strings that could be constants
2626
- gocognit # Cognitive complexity
2727
- unconvert # Remove unnecessary type conversions
28-
- unparam # Unused function parameters
28+
# - unparam # Disabled: panics on Go generics with type constraints (e.g., ~string)
29+
# # See: https://github.com/golangci/golangci-lint/issues/5254
30+
# # revive's unused-parameter rule provides similar coverage
2931
- nakedret # Naked returns in long functions
3032
- prealloc # Slice preallocation
3133
- nilerr # Check for nil error returns
@@ -188,8 +190,7 @@ linters:
188190
nakedret:
189191
max-func-lines: 30
190192

191-
unparam:
192-
check-exported: false
193+
# unparam settings removed - linter disabled due to Go generics panic
193194

194195
revive:
195196
confidence: 0.8

0 commit comments

Comments
 (0)