Skip to content

Commit 0d1b14a

Browse files
committed
replace 4-space with tabs in go templates
1 parent fdb001c commit 0d1b14a

2 files changed

Lines changed: 36 additions & 36 deletions

File tree

modules/openapi-generator/src/main/resources/go-gin-server/routers.mustache

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,25 @@ func NewRouter(handleFunctions ApiHandleFunctions) *gin.Engine {
2626

2727
// NewRouter add routes to existing gin engine.
2828
func NewRouterWithGinEngine(router *gin.Engine, handleFunctions ApiHandleFunctions) *gin.Engine {
29-
for _, route := range getRoutes(handleFunctions) {
30-
if route.HandlerFunc == nil {
31-
route.HandlerFunc = DefaultHandleFunc
32-
}
33-
switch route.Method {
34-
case http.MethodGet:
35-
router.GET(route.Pattern, route.HandlerFunc)
36-
case http.MethodPost:
37-
router.POST(route.Pattern, route.HandlerFunc)
38-
case http.MethodPut:
39-
router.PUT(route.Pattern, route.HandlerFunc)
40-
case http.MethodPatch:
41-
router.PATCH(route.Pattern, route.HandlerFunc)
42-
case http.MethodDelete:
43-
router.DELETE(route.Pattern, route.HandlerFunc)
44-
}
45-
}
29+
for _, route := range getRoutes(handleFunctions) {
30+
if route.HandlerFunc == nil {
31+
route.HandlerFunc = DefaultHandleFunc
32+
}
33+
switch route.Method {
34+
case http.MethodGet:
35+
router.GET(route.Pattern, route.HandlerFunc)
36+
case http.MethodPost:
37+
router.POST(route.Pattern, route.HandlerFunc)
38+
case http.MethodPut:
39+
router.PUT(route.Pattern, route.HandlerFunc)
40+
case http.MethodPatch:
41+
router.PATCH(route.Pattern, route.HandlerFunc)
42+
case http.MethodDelete:
43+
router.DELETE(route.Pattern, route.HandlerFunc)
44+
}
45+
}
4646

47-
return router
47+
return router
4848
}
4949

5050
// Default handler for not yet implemented routes

samples/server/petstore/go-gin-api-server/go/routers.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,25 @@ func NewRouter(handleFunctions ApiHandleFunctions) *gin.Engine {
3434

3535
// NewRouter add routes to existing gin engine.
3636
func NewRouterWithGinEngine(router *gin.Engine, handleFunctions ApiHandleFunctions) *gin.Engine {
37-
for _, route := range getRoutes(handleFunctions) {
38-
if route.HandlerFunc == nil {
39-
route.HandlerFunc = DefaultHandleFunc
40-
}
41-
switch route.Method {
42-
case http.MethodGet:
43-
router.GET(route.Pattern, route.HandlerFunc)
44-
case http.MethodPost:
45-
router.POST(route.Pattern, route.HandlerFunc)
46-
case http.MethodPut:
47-
router.PUT(route.Pattern, route.HandlerFunc)
48-
case http.MethodPatch:
49-
router.PATCH(route.Pattern, route.HandlerFunc)
50-
case http.MethodDelete:
51-
router.DELETE(route.Pattern, route.HandlerFunc)
52-
}
53-
}
37+
for _, route := range getRoutes(handleFunctions) {
38+
if route.HandlerFunc == nil {
39+
route.HandlerFunc = DefaultHandleFunc
40+
}
41+
switch route.Method {
42+
case http.MethodGet:
43+
router.GET(route.Pattern, route.HandlerFunc)
44+
case http.MethodPost:
45+
router.POST(route.Pattern, route.HandlerFunc)
46+
case http.MethodPut:
47+
router.PUT(route.Pattern, route.HandlerFunc)
48+
case http.MethodPatch:
49+
router.PATCH(route.Pattern, route.HandlerFunc)
50+
case http.MethodDelete:
51+
router.DELETE(route.Pattern, route.HandlerFunc)
52+
}
53+
}
5454

55-
return router
55+
return router
5656
}
5757

5858
// Default handler for not yet implemented routes

0 commit comments

Comments
 (0)