Skip to content

Commit 98db209

Browse files
authored
fix: update golangci-lint and clean up error messages (#394)
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent fde5e11 commit 98db209

File tree

3 files changed

+71
-35
lines changed

3 files changed

+71
-35
lines changed

.github/workflows/golangci-lint.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ on:
99

1010
permissions:
1111
contents: read
12-
pull-requests: read
1312

1413
jobs:
1514
golangci:
@@ -21,6 +20,4 @@ jobs:
2120
with:
2221
go-version: 1.23.x
2322
- name: golangci-lint
24-
uses: golangci/golangci-lint-action@v6
25-
with:
26-
only-new-issues: ${{ github.event_name == 'pull_request' && 'true' || 'false' }}
23+
uses: golangci/golangci-lint-action@v7

.golangci.yml

Lines changed: 66 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,71 @@
1-
issues:
2-
exclude-dirs:
3-
- docs
4-
max-issues-per-linter: 0
5-
max-same-issues: 0
1+
version: "2"
2+
run:
3+
issues-exit-code: 1
4+
tests: false
65
linters:
7-
disable:
8-
- depguard
96
enable:
10-
- errcheck
11-
- gosimple
12-
- govet
13-
- ineffassign
14-
- staticcheck
15-
- unused
16-
# Defaults above ours below
7+
- asasalint
8+
- asciicheck
9+
- bidichk
10+
- bodyclose
11+
- contextcheck
1712
- copyloopvar
13+
- durationcheck
14+
- errchkjson
15+
- errorlint
16+
- exhaustive
17+
- fatcontext
18+
- gocheckcompilerdirectives
19+
- gochecksumtype
20+
- gomodguard
21+
- gosec
22+
- gosmopolitan
23+
- loggercheck
24+
- makezero
25+
- musttag
26+
- nilerr
27+
- nilnesserr
28+
- noctx
29+
- perfsprint
30+
- prealloc
31+
- protogetter
32+
- reassign
33+
- recvcheck
34+
- rowserrcheck
35+
- spancheck
36+
- sqlclosecheck
37+
- testifylint
38+
- unparam
1839
- usestdlibvars
1940
- whitespace
20-
presets:
21-
- bugs
22-
- format
23-
- import
24-
- performance
25-
- unused
26-
#linters-settings:
27-
# errcheck:
28-
# check-type-assertions: true
29-
run:
30-
issues-exit-code: 1
31-
tests: false
32-
timeout: 10m
41+
- zerologlint
42+
disable:
43+
- depguard
44+
exclusions:
45+
generated: lax
46+
presets:
47+
- comments
48+
- common-false-positives
49+
- legacy
50+
- std-error-handling
51+
paths:
52+
- docs
53+
- third_party$
54+
- builtin$
55+
- examples$
56+
issues:
57+
max-issues-per-linter: 0
58+
max-same-issues: 0
59+
formatters:
60+
enable:
61+
- gci
62+
- gofmt
63+
- gofumpt
64+
- goimports
65+
exclusions:
66+
generated: lax
67+
paths:
68+
- docs
69+
- third_party$
70+
- builtin$
71+
- examples$

input/chainsync/chainsync.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ func resolveTransactionInputs(
514514
)
515515
if err != nil {
516516
return nil, fmt.Errorf(
517-
"Error fetching matches for input TxId: %s, Index: %d. Error: %w\n",
517+
"error fetching matches for input TxId: %s, Index: %d. Error: %w",
518518
txId,
519519
txIndex,
520520
err,
@@ -523,14 +523,14 @@ func resolveTransactionInputs(
523523

524524
if len(matches) == 0 {
525525
slog.Info(
526-
"No matches found for input TxId: %s, Index: %d, could be due to Kupo not in sync\n",
526+
"no matches found for input TxId: %s, Index: %d, could be due to Kupo not in sync",
527527
txId,
528528
txIndex,
529529
)
530530
} else {
531-
slog.Debug(fmt.Sprintf("Found matches %d for input TxId: %s, Index: %d\n", len(matches), txId, txIndex))
531+
slog.Debug(fmt.Sprintf("found matches %d for input TxId: %s, Index: %d", len(matches), txId, txIndex))
532532
for _, match := range matches {
533-
slog.Debug(fmt.Sprintf("Match: %#v\n", match))
533+
slog.Debug(fmt.Sprintf("Match: %#v", match))
534534
transactionOutput, err := NewResolvedTransactionOutput(match)
535535
if err != nil {
536536
return nil, err

0 commit comments

Comments
 (0)