Skip to content
Myr

docs(comment): Modify comment syntax error (#3389)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by 王哈哈 · committed by GitHub · parent 8b9c55e · Browse files · 2 files+4 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+4 added−4 removed

  • other:+4 added−4 removed

2 files+4 added−4 removed

modified:CHANGELOG.md+1 added-1 removed
111 unmodified lines
112* chore: rename getQueryCache/getFormCache to initQueryCache/initFormCa ([#2375](https://github.com/gin-gonic/gin/pull/2375))113* chore(performance): improve countParams ([#2378](https://github.com/gin-gonic/gin/pull/2378))114* Remove some functions that have the same effect as the bytes package ([#2387](https://github.com/gin-gonic/gin/pull/2387))115* update:SetMode function ([#2321](https://github.com/gin-gonic/gin/pull/2321))116* remove a unused type SecureJSONPrefix ([#2391](https://github.com/gin-gonic/gin/pull/2391))116* remove an unused type SecureJSONPrefix ([#2391](https://github.com/gin-gonic/gin/pull/2391))117* Add a redirect sample for POST method ([#2389](https://github.com/gin-gonic/gin/pull/2389))118* Add CustomRecovery builtin middleware ([#2322](https://github.com/gin-gonic/gin/pull/2322))119* binding: avoid 2038 problem on 32-bit architectures ([#2450](https://github.com/gin-gonic/gin/pull/2450))120* Prevent panic in Context.GetQuery() when there is no Request ([#2412](https://github.com/gin-gonic/gin/pull/2412))
382 unmodified lines
modified:README.md+3 added-3 removed
291 unmodified lines
292func main() {293 router := gin.Default()294295 // Query string parameters are parsed using the existing underlying request object.296 // The request responds to a url matching: /welcome?firstname=Jane&lastname=Doe296 // The request responds to an url matching: /welcome?firstname=Jane&lastname=Doe297 router.GET("/welcome", func(c *gin.Context) {298 firstname := c.DefaultQuery("firstname", "Guest")299 lastname := c.Query("lastname") // shortcut for c.Request.URL.Query().Get("lastname")300
391 unmodified lines
692 - **Behavior** - These methods use `ShouldBindWith` under the hood. If there is a binding error, the error is returned and it is the developer's responsibility to handle the request and error appropriately.693694When using the Bind-method, Gin tries to infer the binder depending on the Content-Type header. If you are sure what you are binding, you can use `MustBindWith` or `ShouldBindWith`.695696You can also specify that specific fields are required. If a field is decorated with `binding:"required"` and has a empty value when binding, an error will be returned.696You can also specify that specific fields are required. If a field is decorated with `binding:"required"` and has an empty value when binding, an error will be returned.697698```go699// Binding from JSON700type Login struct {
1394 unmodified lines
2095 return binding.Validator.ValidateStruct(obj)2096}20972098// Now we can do this!!!2099// FormA is a external type that we can't modify it's tag2099// FormA is an external type that we can't modify it's tag2100type FormA struct {2101 FieldA string `url:"field_a"`2102}2103
267 unmodified lines