Skip to content

Commit

Permalink
Squashed commits:
Browse files Browse the repository at this point in the history
[ad9ec39] Squashed commits:
[0f14acb] #2870 rollback go mod
  • Loading branch information
Danny5487401 authored and kevwan committed Nov 27, 2024
1 parent 636f508 commit 8dd4161
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/zeromicro/go-zero

go 1.21

toolchain go1.21.5
go 1.20

require (
github.com/DATA-DOG/go-sqlmock v1.5.2
Expand Down
5 changes: 3 additions & 2 deletions rest/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (ng *engine) bindRoute(fr featuredRoutes, router httpx.Router, metrics *sta
chn = chain.New()
}
if ng.conf.AddNativeMiddlewares {
ng.buildChainWithNativeMiddlewares(chn, fr, route, metrics)
chn = ng.buildChainWithNativeMiddlewares(chn, fr, route, metrics)
}

chn = ng.appendAuthHandler(fr, chn, verifier)
Expand All @@ -127,7 +127,7 @@ func (ng *engine) bindRoutes(router httpx.Router) error {
}

func (ng *engine) buildChainWithNativeMiddlewares(chn chain.Chain, fr featuredRoutes, route Route,
metrics *stat.Metrics) {
metrics *stat.Metrics) chain.Chain {

if ng.conf.Middlewares.Trace {
chn = chn.Append(handler.TraceHandler(ng.conf.Name,
Expand Down Expand Up @@ -164,6 +164,7 @@ func (ng *engine) buildChainWithNativeMiddlewares(chn chain.Chain, fr featuredRo
if ng.conf.Middlewares.Gunzip {
chn = chn.Append(handler.GunzipHandler)
}
return chn

}

Expand Down
2 changes: 1 addition & 1 deletion rest/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ func TestServer_WithChain(t *testing.T) {
}
}

server := MustNewServer(RestConf{}, WithChain(chain.New(middleware1(), middleware2())))
server := MustNewServer(RestConf{AddNativeMiddlewares: true, Middlewares: MiddlewaresConf{Log: true}}, WithChain(chain.New(middleware1(), middleware2())))
server.AddRoutes(
[]Route{
{
Expand Down
4 changes: 1 addition & 3 deletions tools/goctl/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/zeromicro/go-zero/tools/goctl

go 1.21

toolchain go1.21.5
go 1.20

require (
github.com/DATA-DOG/go-sqlmock v1.5.2
Expand Down

0 comments on commit 8dd4161

Please sign in to comment.