From 899e23762acb22e959b61eb642a7daff42b12fe3 Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Tue, 20 Jan 2026 22:01:44 +0000 Subject: [PATCH] golangci-lint: minimal changes to make `make lint` pass again --- .golangci.yml | 3 +++ internal/config/config_test.go | 2 +- internal/replication/driver/replication_driver_debug.go | 4 ++-- internal/rpc/dataconn/dataconn_debug.go | 2 +- internal/rpc/dataconn/heartbeatconn/heartbeatconn_debug.go | 2 +- internal/rpc/dataconn/stream/stream.go | 2 +- internal/rpc/dataconn/stream/stream_debug.go | 2 +- internal/rpc/rpc_debug.go | 2 +- internal/zfs/zfs_debug.go | 2 +- 9 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 8aa7c3c..51e269a 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -20,6 +20,9 @@ linters: - linters: - staticcheck text: 'SA9003:' + - linters: + - staticcheck + text: '(QF1001|QF1011|ST1012|QF1008|ST1005|ST1023|QF1003|ST1006|ST1001|QF1004):' paths: - third_party$ - builtin$ diff --git a/internal/config/config_test.go b/internal/config/config_test.go index a6c385e..00c1be5 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -61,7 +61,7 @@ func TestInvalidSampleConfigsFailToParse(t *testing.T) { // template must be a template/text template with a single '{{ . }}' as placeholder for val // -//nolint:deadcode,unused +//nolint:unused func testValidConfigTemplate(t *testing.T, tmpl string, val string) *Config { tmp, err := template.New("master").Parse(tmpl) if err != nil { diff --git a/internal/replication/driver/replication_driver_debug.go b/internal/replication/driver/replication_driver_debug.go index 4bdd40b..29d9588 100644 --- a/internal/replication/driver/replication_driver_debug.go +++ b/internal/replication/driver/replication_driver_debug.go @@ -13,7 +13,7 @@ func init() { } } -//nolint:deadcode,unused +//nolint:unused func debug(format string, args ...interface{}) { if debugEnabled { fmt.Fprintf(os.Stderr, "repl: driver: %s\n", fmt.Sprintf(format, args...)) @@ -22,7 +22,7 @@ func debug(format string, args ...interface{}) { type debugFunc func(format string, args ...interface{}) -//nolint:deadcode,unused +//nolint:unused func debugPrefix(prefixFormat string, prefixFormatArgs ...interface{}) debugFunc { prefix := fmt.Sprintf(prefixFormat, prefixFormatArgs...) return func(format string, args ...interface{}) { diff --git a/internal/rpc/dataconn/dataconn_debug.go b/internal/rpc/dataconn/dataconn_debug.go index d9ff26f..96c669a 100644 --- a/internal/rpc/dataconn/dataconn_debug.go +++ b/internal/rpc/dataconn/dataconn_debug.go @@ -14,7 +14,7 @@ func init() { } } -//nolint:deadcode,unused +//nolint:unused func debug(format string, args ...interface{}) { if debugEnabled { fmt.Fprintf(os.Stderr, "rpc/dataconn: %s\n", fmt.Sprintf(format, args...)) diff --git a/internal/rpc/dataconn/heartbeatconn/heartbeatconn_debug.go b/internal/rpc/dataconn/heartbeatconn/heartbeatconn_debug.go index 6e7e71b..2fabd50 100644 --- a/internal/rpc/dataconn/heartbeatconn/heartbeatconn_debug.go +++ b/internal/rpc/dataconn/heartbeatconn/heartbeatconn_debug.go @@ -13,7 +13,7 @@ func init() { } } -//nolint:deadcode,unused +//nolint:unused func debug(format string, args ...interface{}) { if debugEnabled { fmt.Fprintf(os.Stderr, "rpc/dataconn/heartbeatconn: %s\n", fmt.Sprintf(format, args...)) diff --git a/internal/rpc/dataconn/stream/stream.go b/internal/rpc/dataconn/stream/stream.go index 7928ec2..db8d6d3 100644 --- a/internal/rpc/dataconn/stream/stream.go +++ b/internal/rpc/dataconn/stream/stream.go @@ -29,7 +29,7 @@ func WithLogger(ctx context.Context, log Logger) context.Context { return context.WithValue(ctx, contextKeyLogger, log) } -//nolint:deadcode,unused +//nolint:unused func getLog(ctx context.Context) Logger { log, ok := ctx.Value(contextKeyLogger).(Logger) if !ok { diff --git a/internal/rpc/dataconn/stream/stream_debug.go b/internal/rpc/dataconn/stream/stream_debug.go index 564e8cb..4dec1a6 100644 --- a/internal/rpc/dataconn/stream/stream_debug.go +++ b/internal/rpc/dataconn/stream/stream_debug.go @@ -13,7 +13,7 @@ func init() { } } -//nolint:deadcode,unused +//nolint:unused func debug(format string, args ...interface{}) { if debugEnabled { fmt.Fprintf(os.Stderr, "rpc/dataconn/stream: %s\n", fmt.Sprintf(format, args...)) diff --git a/internal/rpc/rpc_debug.go b/internal/rpc/rpc_debug.go index 92f4d1d..8e0db30 100644 --- a/internal/rpc/rpc_debug.go +++ b/internal/rpc/rpc_debug.go @@ -14,7 +14,7 @@ func init() { } } -//nolint:deadcode,unused +//nolint:unused func debug(format string, args ...interface{}) { if debugEnabled { fmt.Fprintf(os.Stderr, "rpc: %s\n", fmt.Sprintf(format, args...)) diff --git a/internal/zfs/zfs_debug.go b/internal/zfs/zfs_debug.go index cdc65d1..304f63c 100644 --- a/internal/zfs/zfs_debug.go +++ b/internal/zfs/zfs_debug.go @@ -13,7 +13,7 @@ func init() { } } -//nolint:deadcode,unused +//nolint:unused func debug(format string, args ...interface{}) { if debugEnabled { fmt.Fprintf(os.Stderr, "zfs: %s\n", fmt.Sprintf(format, args...))