Skip to content

Commit 7e82ea5

Browse files
committed
fix: Disable unparam linter to fix panic on Go generics
The unparam linter panics when analyzing Go code with type constraints (e.g., ~string). This is a known issue affecting Go generics. See: golangci/golangci-lint#5254 Changes: - Disable unparam globally (path exclusions don't prevent analysis panics) - Add err113 and errorlint to test file exclusions for cleaner assertions - revive's unused-parameter rule provides similar coverage for production code
1 parent b5363da commit 7e82ea5

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

.golangci.yml

Lines changed: 5 additions & 7 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
@@ -67,6 +69,8 @@ linters:
6769
- gocritic # Style checks less critical in tests
6870
- nilnil # Tests may use (nil, nil) for mock implementations
6971
- govet # unusedwrite and nilness checks too strict for test scaffolding
72+
- err113 # Direct error comparison acceptable in tests for cleaner assertions
73+
- errorlint # Error wrapping checks too strict for test assertions
7074

7175
# Exclude linters for testdb package (test support utilities)
7276
- path: internal/platform/testdb/
@@ -106,12 +110,6 @@ linters:
106110
- gocyclo
107111
- gocognit
108112

109-
# Exclude unparam for ledger package (unparam panics on Go generics with type constraints)
110-
# See: https://github.com/golangci/golangci-lint/issues/5254
111-
- path: pkg/platform/ledger/.*\.go
112-
linters:
113-
- unparam
114-
115113
# Exclude all linters for integration tests (require external services)
116114
- path: test/integration/
117115
linters:

0 commit comments

Comments
 (0)