You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please provide source code and commit sha if you found a bug.
Review existing issues and provide feedback or react to them.
Description
I used a structure, and the type of a field is itself. When I upload form data and receive it with shoudbind, the stack overflows. Please use the following code to reproduce. I hope to solve this problem. Thank you
How to reproduce
package main
import (
"github.com/gin-gonic/gin"
)
//post form-data a
func main() {
r := gin.Default()
r.POST("/test", TestShoudbind)
r.Run(":8080")
}
func TestShoudbind(c *gin.Context){
a := A{}
c.ShouldBind(&a)
c.JSON(200,a)
}
type A struct {
B string `form:"b" json:"b"`
L *A `json:"l"`
}
Expectations
postman
post http://localhost:8080/test
form-data
b test111
json:{"b":"test111","l":nil}
Actual result
postman
post http://localhost:8080/test
form-data
b test111
runtime: goroutine stack exceeds 1000000000-byte limit
fatal error: stack overflow
Environment
go version:1.3.5
gin version (or commit ref):1.4.0
operating system:macos10.15.2
The text was updated successfully, but these errors were encountered:
Description
I used a structure, and the type of a field is itself. When I upload form data and receive it with shoudbind, the stack overflows. Please use the following code to reproduce. I hope to solve this problem. Thank you
How to reproduce
Expectations
json:{"b":"test111","l":nil}
Actual result
Environment
The text was updated successfully, but these errors were encountered: