Compare commits

...

2 Commits

Author SHA1 Message Date
d8aab7f5c4 fix: add version field for local v2 compatibility and pin CI to v1.64.8
Some checks failed
CI / Build (pull_request) Successful in 6s
CI / Test (pull_request) Successful in 11s
CI / Lint (pull_request) Failing after 4s
CI / Format Check (pull_request) Successful in 2s
- Add version: 2 to .golangci.yml for local golangci-lint v2.1.6 compatibility
- Pin CI to use golangci-lint v1.64.8 explicitly (should support v2 config)

This ensures the config works both locally (v2.1.6) and in CI (v1.64.8).
If v1.64.8 doesn't support v2 config, we may need to upgrade CI to v2.
2025-11-05 13:29:32 +01:00
5f15ebd967 fix: add missing comments to noOpLogger methods and remove deprecated output.format
- Add comments to all noOpLogger methods to satisfy revive exported rule
- Remove deprecated output.format option (use default format instead)

This fixes the linting issues:
- exported: exported method noOpLogger.* should have comment or be unexported
- warning about deprecated output.format option
2025-11-05 13:27:55 +01:00
3 changed files with 19 additions and 7 deletions

View File

@@ -81,7 +81,7 @@ jobs:
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
version: v1.64.8
args: --timeout=5m
build:

View File

@@ -1,6 +1,8 @@
# golangci-lint configuration
# See https://golangci-lint.run/usage/configuration/
version: 2
run:
timeout: 5m
tests: true
@@ -47,6 +49,5 @@ issues:
- revive
output:
format: colored-line-number
print-issued-lines: true
print-linter-name: true

View File

@@ -52,9 +52,20 @@ func ErrorLog(msg string, fields ...Field) {
// Used as a fallback when no global logger is set.
type noOpLogger struct{}
func (n *noOpLogger) Debug(_ string, _ ...Field) {}
func (n *noOpLogger) Info(_ string, _ ...Field) {}
func (n *noOpLogger) Warn(_ string, _ ...Field) {}
func (n *noOpLogger) Error(_ string, _ ...Field) {}
func (n *noOpLogger) With(_ ...Field) Logger { return n }
// Debug implements Logger.Debug as a no-op.
func (n *noOpLogger) Debug(_ string, _ ...Field) {}
// Info implements Logger.Info as a no-op.
func (n *noOpLogger) Info(_ string, _ ...Field) {}
// Warn implements Logger.Warn as a no-op.
func (n *noOpLogger) Warn(_ string, _ ...Field) {}
// Error implements Logger.Error as a no-op.
func (n *noOpLogger) Error(_ string, _ ...Field) {}
// With implements Logger.With as a no-op.
func (n *noOpLogger) With(_ ...Field) Logger { return n }
// WithContext implements Logger.WithContext as a no-op.
func (n *noOpLogger) WithContext(_ context.Context) Logger { return n }