Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion ctx/ctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions event.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

var eventPool = &sync.Pool{
New: func() interface{} {
New: func() any {
return &Event{
buf: bytes.NewBuffer(512),
}
Expand Down Expand Up @@ -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)
}
8 changes: 4 additions & 4 deletions format.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
10 changes: 6 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -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=
Expand All @@ -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=
Expand Down