From 452a911769a6f2e57c83dd34c5840e501e5ed9c3 Mon Sep 17 00:00:00 2001 From: thinkerou Date: Fri, 31 Aug 2018 16:52:08 +0800 Subject: [PATCH] fix indent --- docs/how-to-build-an-effective-middleware.md | 38 ++++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/how-to-build-an-effective-middleware.md b/docs/how-to-build-an-effective-middleware.md index 7ba7c1b6..7e721f6e 100644 --- a/docs/how-to-build-an-effective-middleware.md +++ b/docs/how-to-build-an-effective-middleware.md @@ -8,26 +8,26 @@ The middleware has two parts: - part two is what executes on every request. For example, a database middleware you simply inject your "global" database object into the context. Once it's inside the context, you can retrieve it from within other middlewares and your handler furnction. -```go -func funcName(params string) gin.HandlerFunc { - // <--- - // This is part one - // ---> - // The follow code is an example - if err := check(params); err != nil { - panic(err) - } + ```go + func funcName(params string) gin.HandlerFunc { + // <--- + // This is part one + // ---> + // The follow code is an example + if err := check(params); err != nil { + panic(err) + } - return func(c *gin.Context) { - // <--- - // This is part two - // ---> - // The follow code is an example - c.Set("TestVar", params) - c.Next() - } -} -``` + return func(c *gin.Context) { + // <--- + // This is part two + // ---> + // The follow code is an example + c.Set("TestVar", params) + c.Next() + } + } + ``` ## Execution process