Skip to content

Commit 4451b47

Browse files
exp: Update slog, adjust for changes (#1276)
Updates to the most recent release of https://github.com/golang/exp. Adjusts code for API changes based on [this](golang/exp@be6415c#diff-e01ca481b9eee7f4ab6b255ae0e5967a0705d64792f6a8ecddd9190fec8763f3R91). Co-authored-by: Dzaka Ammar <dzaka.ammar@mekari.com>
1 parent 845ca51 commit 4451b47

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

exp/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.19
55
require (
66
github.com/stretchr/testify v1.8.1
77
go.uber.org/zap v1.24.0
8-
golang.org/x/exp v0.0.0-20230315142452-642cacee5cc0
8+
golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53
99
)
1010

1111
require (

exp/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ=
1919
go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
2020
go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60=
2121
go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg=
22-
golang.org/x/exp v0.0.0-20230315142452-642cacee5cc0 h1:pVgRXcIictcr+lBQIFeiwuwtDIs4eL21OuM9nyAADmo=
23-
golang.org/x/exp v0.0.0-20230315142452-642cacee5cc0/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
22+
golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 h1:5llv2sWeaMSnA3w2kS57ouQQ4pudlXrR0dCgw51QK9o=
23+
golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w=
2424
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
2525
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
2626
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

exp/zapslog/slog.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,9 @@ func (h *Handler) Handle(ctx context.Context, record slog.Record) error {
158158
}
159159

160160
fields := make([]zapcore.Field, 0, record.NumAttrs())
161-
record.Attrs(func(attr slog.Attr) {
161+
record.Attrs(func(attr slog.Attr) bool {
162162
fields = append(fields, convertAttrToField(attr))
163+
return true
163164
})
164165
ce.Write(fields...)
165166
return nil

0 commit comments

Comments
 (0)