aboutsummaryrefslogtreecommitdiff
path: root/pkg/ext
diff options
context:
space:
mode:
authorGabriel Arakaki Giovanini <mail@gabrielgio.me>2023-12-01 00:52:33 +0100
committerGabriel Arakaki Giovanini <mail@gabrielgio.me>2023-12-01 00:52:33 +0100
commit29e9fd3136f2e2fe301cbe07967fb3bb4ffcee2a (patch)
treecf5248dc0c3efd21845062d4885ed0dd0890d9cb /pkg/ext
parent417041797674319485bea96cb38489670ff3b2ef (diff)
downloadlens-29e9fd3136f2e2fe301cbe07967fb3bb4ffcee2a.tar.gz
lens-29e9fd3136f2e2fe301cbe07967fb3bb4ffcee2a.tar.bz2
lens-29e9fd3136f2e2fe301cbe07967fb3bb4ffcee2a.zip
fix: Rollback to exp slog repositoryHEADmaster
This is done until go1.21 hits alpine repository.
Diffstat (limited to 'pkg/ext')
-rw-r--r--pkg/ext/gorm_logger.go2
-rw-r--r--pkg/ext/middleware.go5
2 files changed, 3 insertions, 4 deletions
diff --git a/pkg/ext/gorm_logger.go b/pkg/ext/gorm_logger.go
index f0ab592..ddced21 100644
--- a/pkg/ext/gorm_logger.go
+++ b/pkg/ext/gorm_logger.go
@@ -3,9 +3,9 @@ package ext
import (
"context"
"fmt"
- "log/slog"
"time"
+ "golang.org/x/exp/slog"
"gorm.io/gorm/logger"
"gorm.io/gorm/utils"
)
diff --git a/pkg/ext/middleware.go b/pkg/ext/middleware.go
index 38bacca..d9f06e1 100644
--- a/pkg/ext/middleware.go
+++ b/pkg/ext/middleware.go
@@ -4,10 +4,11 @@ import (
"context"
"encoding/base64"
"errors"
- "log/slog"
"net/http"
"time"
+ "golang.org/x/exp/slog"
+
"git.sr.ht/~gabrielgio/img/pkg/database/repository"
"git.sr.ht/~gabrielgio/img/pkg/service"
)
@@ -47,7 +48,6 @@ func (l *LogMiddleware) HTTP(next http.HandlerFunc) http.HandlerFunc {
slog.Duration("elapsed", elapsed),
slog.String("path", r.URL.Path),
)
-
}
}
@@ -135,7 +135,6 @@ func NewInitialSetupMiddleware(userRepository repository.UserRepository) *Initia
func (i *InitialSetupMiddleware) Check(next http.HandlerFunc) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
-
// if user has been set to context it is logged in already
token := GetUserFromCtx(r)
if token != nil {