From 020123626cc64b804292ed7f2ca4194db2a5cecb Mon Sep 17 00:00:00 2001 From: Samuel Berthe Date: Tue, 25 Apr 2023 22:43:50 +0200 Subject: [PATCH] chore: upgrade to go1.20.3 and x/exp nightly --- .github/workflows/lint.yml | 4 ++-- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 2 +- README.md | 4 ++-- converter.go | 3 ++- go.mod | 5 +---- go.sum | 6 ++---- 7 files changed, 11 insertions(+), 15 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 26ae514..50430ea 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,7 +13,7 @@ jobs: steps: - uses: actions/setup-go@v2 with: - go-version: 1.20.1 + go-version: 1.20.3 stable: false - uses: actions/checkout@v2 - name: golangci-lint @@ -41,4 +41,4 @@ jobs: # skip-build-cache: true # optionally use a specific version of Go rather than the latest one - go_version: '1.20.1' + go_version: '1.20.3' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a298aec..798e403 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.20.1 + go-version: 1.20.3 stable: false - name: Test diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b6b2299..a004c74 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.20.1 + go-version: 1.20.3 stable: false - name: Build diff --git a/README.md b/README.md index 5dfc14c..9638238 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ # slog: Syslog handler [![tag](https://img.shields.io/github/tag/samber/slog-syslog.svg)](https://github.com/samber/slog-syslog/releases) -![Go Version](https://img.shields.io/badge/Go-%3E%3D%201.20.1-%23007d9c) +![Go Version](https://img.shields.io/badge/Go-%3E%3D%201.20.3-%23007d9c) [![GoDoc](https://godoc.org/github.com/samber/slog-syslog?status.svg)](https://pkg.go.dev/github.com/samber/slog-syslog) ![Build Status](https://github.com/samber/slog-syslog/actions/workflows/test.yml/badge.svg) [![Go report](https://goreportcard.com/badge/github.com/samber/slog-syslog)](https://goreportcard.com/report/github.com/samber/slog-syslog) @@ -31,7 +31,7 @@ A Syslog Handler for [slog](https://pkg.go.dev/golang.org/x/exp/slog) Go library go get github.com/samber/slog-syslog ``` -**Compatibility**: go >= 1.20.1 +**Compatibility**: go >= 1.20.3 This library is v0 and follows SemVer strictly. On `slog` final release (go 1.21), this library will go v1. diff --git a/converter.go b/converter.go index 0b53f06..d1c2f0a 100644 --- a/converter.go +++ b/converter.go @@ -19,10 +19,11 @@ func DefaultConverter(loggerAttr []slog.Attr, record *slog.Record) map[string]an extra := attrsToValue(loggerAttr) - record.Attrs(func(attr slog.Attr) { + record.Attrs(func(attr slog.Attr) bool { for k, v := range attrsToValue([]slog.Attr{attr}) { extra[k] = v } + return true }) if err, ok := extra["error"]; ok { diff --git a/go.mod b/go.mod index a31426a..0c33ab9 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,4 @@ module github.com/samber/slog-syslog go 1.20 -require ( - github.com/netbrain/goautosocket v0.0.0-20150624145746-bef85f0aef40 - golang.org/x/exp v0.0.0-20230321023759-10a507213a29 -) +require golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 diff --git a/go.sum b/go.sum index 417fc03..268a27e 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,2 @@ -github.com/netbrain/goautosocket v0.0.0-20150624145746-bef85f0aef40 h1:bOeCk5udqJgLIrCzxS5nZcufOTHtu7ap5bYsqx4w4/I= -github.com/netbrain/goautosocket v0.0.0-20150624145746-bef85f0aef40/go.mod h1:o7i/4orMnh/ZmJef4SeqvqHo2ZjO++jU9e03S9725r8= -golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug= -golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 h1:5llv2sWeaMSnA3w2kS57ouQQ4pudlXrR0dCgw51QK9o= +golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w=