feat: go gin murr
parent
3353dd5e95
commit
80f11ddebe
|
@ -454,10 +454,17 @@ internal
|
|||
>Use <a href="https://github.com/gin-gonic/gin">gin-gonic/gin</a> for
|
||||
REST.
|
||||
</h3>
|
||||
<p>
|
||||
Don't use <code>gin.Context</code> when pass context from handler layer to
|
||||
service layer, use <code>gin.Context.Request.Context()</code> instead.
|
||||
</p>
|
||||
<p>With <code>c *gin.Context</code>:</p>
|
||||
<ul>
|
||||
<li>
|
||||
Don't use <code>c</code> when passing context, use
|
||||
<code>c.Request.Context()</code> instead.
|
||||
</li>
|
||||
<li>
|
||||
Don't use <code>c.Request.URL.Path</code>, use
|
||||
<code>c.FullPath()</code> instead.
|
||||
</li>
|
||||
</ul>
|
||||
<p>Remember to free resources after parse multipart form:</p>
|
||||
<div class="highlight highlight-source-go">
|
||||
<pre><span class="pl-k">defer</span> <span class="pl-k">func</span>() {
|
||||
|
|
|
@ -233,7 +233,10 @@ prototool is deprecated, and buf can generate, lint, format as good as prototool
|
|||
|
||||
### Use [gin-gonic/gin](https://github.com/gin-gonic/gin) for REST.
|
||||
|
||||
Don't use `gin.Context` when pass context from handler layer to service layer, use `gin.Context.Request.Context()` instead.
|
||||
With `c *gin.Context`:
|
||||
|
||||
- Don't use `c` when passing context, use `c.Request.Context()` instead.
|
||||
- Don't use `c.Request.URL.Path`, use `c.FullPath()` instead.
|
||||
|
||||
Remember to free resources after parse multipart form:
|
||||
|
||||
|
|
Loading…
Reference in New Issue