From 086de45f30861f4a8328cebab4ede4e50d51a61c Mon Sep 17 00:00:00 2001 From: PennyYoon <525296438@qq.com> Date: Sun, 29 Dec 2024 12:10:12 +0800 Subject: [PATCH] build: bump minimal required go version to 1.21 --- README.md | 2 +- examples/slog_simple_example.go | 2 +- go.mod | 7 ++----- go.sum | 2 -- handler.go | 3 +-- handler_error_test.go | 2 +- handler_format_test.go | 2 +- handler_level_test.go | 2 +- 8 files changed, 8 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 741609d..77c6a29 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ ## 📋 Requirements -- Go 1.20+ +- Go 1.21+ ## 🚀 Install diff --git a/examples/slog_simple_example.go b/examples/slog_simple_example.go index af1810b..a01c155 100644 --- a/examples/slog_simple_example.go +++ b/examples/slog_simple_example.go @@ -1,10 +1,10 @@ package main import ( + "log/slog" "os" "github.com/libgox/slogsimple" - "golang.org/x/exp/slog" ) func main() { diff --git a/go.mod b/go.mod index 35ebcd1..8af39dd 100644 --- a/go.mod +++ b/go.mod @@ -1,11 +1,8 @@ module github.com/libgox/slogsimple -go 1.20 +go 1.21 -require ( - github.com/stretchr/testify v1.9.0 - golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 -) +require github.com/stretchr/testify v1.9.0 require ( github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/go.sum b/go.sum index 0915083..60ce688 100644 --- a/go.sum +++ b/go.sum @@ -4,8 +4,6 @@ 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.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 h1:kx6Ds3MlpiUHKj7syVnbp57++8WpuKPcR5yjLBjvLEA= -golang.org/x/exp v0.0.0-20240823005443-9b4947da3948/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= 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= diff --git a/handler.go b/handler.go index adf0468..895aa1c 100644 --- a/handler.go +++ b/handler.go @@ -3,10 +3,9 @@ package slogsimple import ( "context" "io" + "log/slog" "strings" "time" - - "golang.org/x/exp/slog" ) type Config struct { diff --git a/handler_error_test.go b/handler_error_test.go index 2775fc5..e233c49 100644 --- a/handler_error_test.go +++ b/handler_error_test.go @@ -4,10 +4,10 @@ import ( "bytes" "context" "errors" + "log/slog" "testing" "github.com/stretchr/testify/assert" - "golang.org/x/exp/slog" ) type ErrorWriter struct{} diff --git a/handler_format_test.go b/handler_format_test.go index e57ee87..ce72d1c 100644 --- a/handler_format_test.go +++ b/handler_format_test.go @@ -3,11 +3,11 @@ package slogsimple import ( "bytes" "context" + "log/slog" "testing" "time" "github.com/stretchr/testify/assert" - "golang.org/x/exp/slog" ) func TestLogFormatBasic(t *testing.T) { diff --git a/handler_level_test.go b/handler_level_test.go index 16e9d6e..b1bfbe1 100644 --- a/handler_level_test.go +++ b/handler_level_test.go @@ -3,10 +3,10 @@ package slogsimple import ( "bytes" "context" + "log/slog" "testing" "github.com/stretchr/testify/assert" - "golang.org/x/exp/slog" ) func TestLogLevelFiltering(t *testing.T) {