summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander NeonXP Kiryukhin <i@neonxp.ru>2024-04-06 20:44:41 +0300
committerAlexander NeonXP Kiryukhin <i@neonxp.ru>2024-04-06 20:44:41 +0300
commitd97aec1586e805dec59ce5d2e45e451d71ba3af1 (patch)
treed3b7da7c8d1895792b3f78e45ca79dadd38e2749
parent7908b1e119fe4fdc4a29130c950a9c7781f99081 (diff)
обновил либы
-rw-r--r--go.mod2
-rw-r--r--go.sum2
-rw-r--r--main.go8
3 files changed, 8 insertions, 4 deletions
diff --git a/go.mod b/go.mod
index 9636160..b7cd7b7 100644
--- a/go.mod
+++ b/go.mod
@@ -2,6 +2,6 @@ module go.neonxp.dev/pkg
go 1.22.1
-require gitrepo.ru/neonxp/middleware v0.0.0-20240406170514-e2509238d2b7
+require gitrepo.ru/neonxp/middleware v0.0.0-20240406173909-2e050160b553
require github.com/google/uuid v1.6.0 // indirect
diff --git a/go.sum b/go.sum
index 2d319a5..f1e32e7 100644
--- a/go.sum
+++ b/go.sum
@@ -2,3 +2,5 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
gitrepo.ru/neonxp/middleware v0.0.0-20240406170514-e2509238d2b7 h1:fcaAepmyVZMDA2UllERGKEXO5u9rvyWIbk83EvV4zoU=
gitrepo.ru/neonxp/middleware v0.0.0-20240406170514-e2509238d2b7/go.mod h1:5K+tNLUK80Oo/Yy5wyILIk9KjjX0X/mhzkh67aEnUmk=
+gitrepo.ru/neonxp/middleware v0.0.0-20240406173909-2e050160b553 h1:U1KYhZrqBM+uvzsa4bQYZbEHxbO/5YfZqK2fBVvFfW4=
+gitrepo.ru/neonxp/middleware v0.0.0-20240406173909-2e050160b553/go.mod h1:5K+tNLUK80Oo/Yy5wyILIk9KjjX0X/mhzkh67aEnUmk=
diff --git a/main.go b/main.go
index 0ba6106..49abeb8 100644
--- a/main.go
+++ b/main.go
@@ -65,9 +65,11 @@ func main() {
mux.Handle("GET /static/", http.FileServerFS(staticFS))
logger := slog.New(slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{}))
- h := middleware.Logger(mux, logger)
- h = middleware.Recover(h, logger)
- h = middleware.RequestID(h)
+ h := middleware.Use(mux,
+ middleware.Logger(logger),
+ middleware.Recover(logger),
+ middleware.RequestID,
+ )
srv := &http.Server{
Handler: h,