Skip to content

Commit d7c634e

Browse files
committed
⬆️ Update route122 version
1 parent 36631d3 commit d7c634e

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed

application.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ import (
88

99
// An Application is a container which includes middlewares and config, and implemented the GO's net/http.Handler interface https://golang.org/pkg/net/http/#Handler.
1010
type Application struct {
11-
router *route122.Router
11+
router *route122.Router[Handler]
1212
middlewares []Handler
1313
configs map[string]string
1414
}
1515

1616
// New returns a new vox Application.
1717
func New() *Application {
1818
app := &Application{
19-
router: route122.New(),
19+
router: route122.New[Handler](),
2020
configs: map[string]string{},
2121
}
2222
app.middlewares = []Handler{logging, app.routeHandler, respond}

go.mod

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
module github.com/aisk/vox
22

3-
go 1.22
3+
go 1.18
44

5-
toolchain go1.23.5
6-
7-
require github.com/aisk/route122 v0.0.0-20251129140018-16cd6cc48089
5+
require github.com/aisk/route122 v0.0.0-20251202161139-dcb9ea5032bf
86

97
require (
108
golang.org/x/net v0.35.0 // indirect

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
github.com/aisk/route122 v0.0.0-20251129140018-16cd6cc48089 h1:FN73eBiN0dKR4WI1RjxiKssNVD+MMJAz4r/+BxrER5A=
2-
github.com/aisk/route122 v0.0.0-20251129140018-16cd6cc48089/go.mod h1:wV8INfN/2tGkuHol+j0Fjrz3iZijZrMJkB+A8LoZQNU=
1+
github.com/aisk/route122 v0.0.0-20251202161139-dcb9ea5032bf h1:ErBxXOkr2O2/fJUK3DdJ2+pJiN4uWiOkPfK1n09/T04=
2+
github.com/aisk/route122 v0.0.0-20251202161139-dcb9ea5032bf/go.mod h1:jkw+s53hE0F8zPUqoYdTASdv5RAD0HAvKOepG/kJCas=
33
golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8=
44
golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk=
55
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=

route.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ func (app *Application) routeHandler(ctx *Context, req *Request, res *Response)
77
for k, v := range match.Params {
88
req.Params[k] = v
99
}
10-
if h, ok := match.Handler.(Handler); ok {
11-
h(ctx, req, res)
12-
}
10+
h := match.Handler
11+
h(ctx, req, res)
1312
}
1413
ctx.Next()
1514
}

0 commit comments

Comments
 (0)