Skip to content

Commit

Permalink
chore: upgrade to go1.20.3 and x/exp nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
samber committed Apr 25, 2023
1 parent cccc135 commit 0201236
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.

Expand Down
3 changes: 2 additions & 1 deletion converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 1 addition & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -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=

0 comments on commit 0201236

Please sign in to comment.