From e2d54012966ff3f42a2033d23628eced3f8ad85e Mon Sep 17 00:00:00 2001 From: Nicholas Wiersma Date: Thu, 11 Dec 2025 13:48:56 +0200 Subject: [PATCH] chore: bump dependencies --- .github/workflows/test.yml | 2 +- .golangci.yml | 8 ++++++++ ctx/ctx.go | 2 +- event.go | 4 ++-- format.go | 8 ++++---- go.mod | 5 +++-- go.sum | 10 ++++++---- 7 files changed, 25 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c331fb7..30080d2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,7 @@ jobs: go-version: [ "1.24", "1.25" ] runs-on: ubuntu-latest env: - GOLANGCI_LINT_VERSION: v2.4.0 + GOLANGCI_LINT_VERSION: v2.7.2 steps: - name: Checkout code diff --git a/.golangci.yml b/.golangci.yml index 626ca33..93c72e5 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -44,6 +44,14 @@ linters: settings: cyclop: max-complexity: 12 + revive: + rules: + - name: var-naming + arguments: + - [] + - [] + - - skip-package-name-checks: true + skip-package-name-collision-with-go-std: true exclusions: generated: lax rules: diff --git a/ctx/ctx.go b/ctx/ctx.go index 58bac4a..7b00d53 100644 --- a/ctx/ctx.go +++ b/ctx/ctx.go @@ -182,7 +182,7 @@ func Duration(k string, d time.Duration) logger.Field { } // Interface returns an interface context field. -func Interface(k string, v interface{}) logger.Field { +func Interface(k string, v any) logger.Field { return func(e *logger.Event) { e.AppendInterface(k, v) } diff --git a/event.go b/event.go index 4535da3..20307b8 100644 --- a/event.go +++ b/event.go @@ -8,7 +8,7 @@ import ( ) var eventPool = &sync.Pool{ - New: func() interface{} { + New: func() any { return &Event{ buf: bytes.NewBuffer(512), } @@ -114,7 +114,7 @@ func (e *Event) AppendDuration(k string, d time.Duration) { } // AppendInterface appends a interface to the event. -func (e *Event) AppendInterface(k string, v interface{}) { +func (e *Event) AppendInterface(k string, v any) { e.fmtr.AppendKey(e.buf, k) e.fmtr.AppendInterface(e.buf, v) } diff --git a/format.go b/format.go index 076affb..94d597b 100644 --- a/format.go +++ b/format.go @@ -35,7 +35,7 @@ type Formatter interface { AppendFloat(buf *bytes.Buffer, f float64) AppendTime(buf *bytes.Buffer, t time.Time) AppendDuration(buf *bytes.Buffer, d time.Duration) - AppendInterface(buf *bytes.Buffer, v interface{}) + AppendInterface(buf *bytes.Buffer, v any) } type json struct{} @@ -127,7 +127,7 @@ func (j *json) AppendDuration(buf *bytes.Buffer, d time.Duration) { appendString(buf, s, true) } -func (j *json) AppendInterface(buf *bytes.Buffer, v interface{}) { +func (j *json) AppendInterface(buf *bytes.Buffer, v any) { if v == nil { buf.WriteString("null") return @@ -225,7 +225,7 @@ func (l *logfmt) AppendDuration(buf *bytes.Buffer, d time.Duration) { appendString(buf, s, l.needsQuote(s)) } -func (l *logfmt) AppendInterface(buf *bytes.Buffer, v interface{}) { +func (l *logfmt) AppendInterface(buf *bytes.Buffer, v any) { if v == nil { return } @@ -371,7 +371,7 @@ func (c *console) AppendDuration(buf *bytes.Buffer, d time.Duration) { appendString(buf, s, false) } -func (c *console) AppendInterface(buf *bytes.Buffer, v interface{}) { +func (c *console) AppendInterface(buf *bytes.Buffer, v any) { if v == nil { return } diff --git a/go.mod b/go.mod index dc5e889..0684ea2 100644 --- a/go.mod +++ b/go.mod @@ -5,12 +5,13 @@ go 1.24.0 require ( github.com/go-stack/stack v1.8.1 github.com/stretchr/testify v1.11.1 - go.opentelemetry.io/otel/trace v1.38.0 + go.opentelemetry.io/otel/trace v1.39.0 ) require ( + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - go.opentelemetry.io/otel v1.38.0 // indirect + go.opentelemetry.io/otel v1.39.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 7402dab..b15ea9e 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,5 @@ +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= @@ -8,10 +10,10 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= -go.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8= -go.opentelemetry.io/otel v1.38.0/go.mod h1:zcmtmQ1+YmQM9wrNsTGV/q/uyusom3P8RxwExxkZhjM= -go.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE= -go.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs= +go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= +go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= +go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= +go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=