From 27106a03f962c56091a5161c9620d9df296ac4e1 Mon Sep 17 00:00:00 2001 From: Janos Guljas Date: Sat, 17 Dec 2022 16:32:54 +0100 Subject: [PATCH] Update golang.org/x/exp --- go.mod | 10 +++++----- go.sum | 22 +++++++++++----------- logging/access_log.go | 10 +++++----- recovery/recovery.go | 6 +++--- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/go.mod b/go.mod index c4b6792..c4dde58 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/lucas-clemente/quic-go v0.31.1 github.com/prometheus/client_golang v1.14.0 golang.org/x/crypto v0.4.0 - golang.org/x/exp v0.0.0-20221208152030-732eee02a75a + golang.org/x/exp v0.0.0-20221215174704-0915cd710c24 golang.org/x/net v0.4.0 google.golang.org/grpc v1.51.0 google.golang.org/protobuf v1.28.1 @@ -16,7 +16,7 @@ require ( resenje.org/iostuff v0.1.3 resenje.org/jsonhttp v0.2.0 resenje.org/recovery v0.1.1 - resenje.org/x v0.5.0 + resenje.org/x v0.5.4 ) require ( @@ -25,14 +25,14 @@ require ( github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect github.com/golang/mock v1.6.0 // indirect github.com/golang/protobuf v1.5.2 // indirect - github.com/google/pprof v0.0.0-20221203041831-ce31453925ec // indirect + github.com/google/pprof v0.0.0-20221212185716-aee1124e3a93 // indirect github.com/marten-seemann/qpack v0.3.0 // indirect github.com/marten-seemann/qtls-go1-18 v0.1.3 // indirect github.com/marten-seemann/qtls-go1-19 v0.1.1 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/onsi/ginkgo/v2 v2.5.1 // indirect + github.com/onsi/ginkgo/v2 v2.6.1 // indirect github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.38.0 // indirect + github.com/prometheus/common v0.39.0 // indirect github.com/prometheus/procfs v0.8.0 // indirect golang.org/x/mod v0.7.0 // indirect golang.org/x/sys v0.3.0 // indirect diff --git a/go.sum b/go.sum index fe51ff7..4eda321 100644 --- a/go.sum +++ b/go.sum @@ -20,8 +20,8 @@ github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/pprof v0.0.0-20221203041831-ce31453925ec h1:fR20TYVVwhK4O7r7y+McjRYyaTH6/vjwJOajE+XhlzM= -github.com/google/pprof v0.0.0-20221203041831-ce31453925ec/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo= +github.com/google/pprof v0.0.0-20221212185716-aee1124e3a93 h1:D5iJJZKAi0rU4e/5E58BkrnN+xeCDjAIqcm1GGxAGSI= +github.com/google/pprof v0.0.0-20221212185716-aee1124e3a93/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/lucas-clemente/quic-go v0.31.1 h1:O8Od7hfioqq0PMYHDyBkxU2aA7iZ2W9pjbrWuja2YR4= @@ -34,17 +34,17 @@ github.com/marten-seemann/qtls-go1-19 v0.1.1 h1:mnbxeq3oEyQxQXwI4ReCgW9DPoPR94sN github.com/marten-seemann/qtls-go1-19 v0.1.1/go.mod h1:5HTDWtVudo/WFsHKRNuOhWlbdjrfs5JHrYb0wIJqGpI= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/onsi/ginkgo/v2 v2.5.1 h1:auzK7OI497k6x4OvWq+TKAcpcSAlod0doAH72oIN0Jw= -github.com/onsi/ginkgo/v2 v2.5.1/go.mod h1:63DOGlLAH8+REH8jUGdL3YpCpu7JODesutUjdENfUAc= -github.com/onsi/gomega v1.24.0 h1:+0glovB9Jd6z3VR+ScSwQqXVTIfJcGA9UBM8yzQxhqg= +github.com/onsi/ginkgo/v2 v2.6.1 h1:1xQPCjcqYw/J5LchOcp4/2q/jzJFjiAOc25chhnDw+Q= +github.com/onsi/ginkgo/v2 v2.6.1/go.mod h1:yjiuMwPokqY1XauOgju45q3sJt6VzQ/Fict1LFVcsAo= +github.com/onsi/gomega v1.24.1 h1:KORJXNNTzJXzu4ScJWssJfJMnJ+2QJqhoQSRwNlze9E= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= -github.com/prometheus/common v0.38.0 h1:VTQitp6mXTdUoCmDMugDVOJ1opi6ADftKfp/yeqTR/E= -github.com/prometheus/common v0.38.0/go.mod h1:MBXfmBQZrK5XpbCkjofnXs96LD2QQ7fEq4C0xjC/yec= +github.com/prometheus/common v0.39.0 h1:oOyhkDq05hPZKItWVBkJ6g6AtGxi+fy7F4JvUV8uhsI= +github.com/prometheus/common v0.39.0/go.mod h1:6XBZ7lYdLCbkAVhwRsWTZn+IN5AB9F/NXd5w0BbEX0Y= github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -55,8 +55,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.4.0 h1:UVQgzMY87xqpKNgb+kDsll2Igd33HszWHFLmpaRMq/8= golang.org/x/crypto v0.4.0/go.mod h1:3quD/ATkf6oY+rnes5c3ExXTbLc8mueNue5/DoinL80= -golang.org/x/exp v0.0.0-20221208152030-732eee02a75a h1:4iLhBPcpqFmylhnkbY3W0ONLUYYkDAW9xMFLfxgsvCw= -golang.org/x/exp v0.0.0-20221208152030-732eee02a75a/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/exp v0.0.0-20221215174704-0915cd710c24 h1:6w3iSY8IIkp5OQtbYj8NeuKG1jS9d+kYaubXqsoOiQ8= +golang.org/x/exp v0.0.0-20221215174704-0915cd710c24/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.7.0 h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= @@ -112,5 +112,5 @@ resenje.org/jsonhttp v0.2.0 h1:muOrhvgScixgVKAlYFcB8CKNxH95gnsqrf61P0Mpze0= resenje.org/jsonhttp v0.2.0/go.mod h1:EDyeguyTWj2fU3D3SCE0qNTgthzyEkHYLM1uu0uikHU= resenje.org/recovery v0.1.1 h1:/mXWD5S97BKF2B1/GxRUnWRuX2ZK4/4vSO70vsO1IYc= resenje.org/recovery v0.1.1/go.mod h1:3S6aCVKMJEWsSAb61oZTteaiqkIfQPTr1RdiWnRbhME= -resenje.org/x v0.5.0 h1:WGzfKfmhwC4rsYXm7li2n8LWDEx2AHJBhpMszCbH2VQ= -resenje.org/x v0.5.0/go.mod h1:QL8pBpjL2NIsDUSSDF37inb9HO1BBgnvkkygskj81yc= +resenje.org/x v0.5.4 h1:2taHmdHxz2Y/EaTFcI1Dl+nv6R77JPwNmCVaIXElKFY= +resenje.org/x v0.5.4/go.mod h1:2G0mHvqEyijakPTY6l8EQRXNfFkbGBI6jUmsKUvwAYk= diff --git a/logging/access_log.go b/logging/access_log.go index c7bcfda..9ffcec5 100644 --- a/logging/access_log.go +++ b/logging/access_log.go @@ -83,15 +83,15 @@ func NewAccessLogHandler(h http.Handler, logger *slog.Logger, o *AccessLogOption var level slog.Level switch { case status >= 500: - level = slog.ErrorLevel + level = slog.LevelError case status >= 400: - level = slog.WarnLevel + level = slog.LevelWarn case status >= 300: - level = slog.InfoLevel + level = slog.LevelInfo case status >= 200: - level = slog.InfoLevel + level = slog.LevelInfo default: - level = slog.DebugLevel + level = slog.LevelDebug } logger.LogAttrs(level, logMessage, attrs...) diff --git a/recovery/recovery.go b/recovery/recovery.go index dc54368..287935a 100644 --- a/recovery/recovery.go +++ b/recovery/recovery.go @@ -87,13 +87,13 @@ func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { if h.label != "" { debugMsg = h.label + "\n\n" + debugMsg } - h.logger.Log(slog.ErrorLevel, "http recovery handler", "method", r.Method, "url", r.URL.String(), slog.ErrorKey, err, "debug", debugMsg) + h.logger.Log(slog.LevelError, "http recovery handler", "method", r.Method, "url", r.URL.String(), slog.ErrorKey, err, "debug", debugMsg) if h.notifier != nil { go func() { defer func() { if err := recover(); err != nil { - h.logger.Log(slog.ErrorLevel, "http recovery handler: notify panic", slog.Any(slog.ErrorKey, err)) + h.logger.Log(slog.LevelError, "http recovery handler: notify panic", slog.Any(slog.ErrorKey, err)) } }() @@ -107,7 +107,7 @@ func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { ), debugMsg, ); err != nil { - h.logger.Log(slog.ErrorLevel, "http recovery handler: notify", slog.Any(slog.ErrorKey, err)) + h.logger.Log(slog.LevelError, "http recovery handler: notify", slog.Any(slog.ErrorKey, err)) } }() }