feat: go 1.22 and slog migration (#557)

This change adds Go 1.22 as a build target and drops support for Go 1.20 and older. The golang.org/x/exp/slog import is migrated to log/slog.

Slog has been part of the Go standard library since Go 1.21. Therefore we are dropping support for older Go versions. This is in line of our support policy of "the latest two Go versions".
This commit is contained in:
Tim Möhlmann 2024-02-28 11:44:14 +02:00 committed by GitHub
parent 38c025f7f8
commit 972b8981e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 106 additions and 120 deletions

View file

@ -4,6 +4,7 @@ import (
"context"
"encoding/json"
"fmt"
"log/slog"
"net/http"
"os"
"strings"
@ -12,7 +13,6 @@ import (
"github.com/google/uuid"
"github.com/sirupsen/logrus"
"golang.org/x/exp/slog"
"github.com/zitadel/logging"
"github.com/zitadel/oidc/v3/pkg/client/rp"

View file

@ -3,13 +3,13 @@ package exampleop
import (
"crypto/sha256"
"log"
"log/slog"
"net/http"
"sync/atomic"
"time"
"github.com/go-chi/chi/v5"
"github.com/zitadel/logging"
"golang.org/x/exp/slog"
"golang.org/x/text/language"
"github.com/zitadel/oidc/v3/example/server/storage"

View file

@ -2,12 +2,12 @@ package main
import (
"fmt"
"log/slog"
"net/http"
"os"
"github.com/zitadel/oidc/v3/example/server/exampleop"
"github.com/zitadel/oidc/v3/example/server/storage"
"golang.org/x/exp/slog"
)
func main() {

View file

@ -1,9 +1,9 @@
package storage
import (
"log/slog"
"time"
"golang.org/x/exp/slog"
"golang.org/x/text/language"
"github.com/zitadel/oidc/v3/pkg/oidc"