TestContextBadAutoShouldBind() — gin Function Reference
Architecture documentation for the TestContextBadAutoShouldBind() function in context_test.go from the gin codebase.
Entity Profile
Dependency Diagram
graph TD 8aaeed8c_e4a9_f3dc_fcde_9856b037d975["TestContextBadAutoShouldBind()"] ebe0ae48_a62b_a38f_5bac_5bbbd96fc508["context_test.go"] 8aaeed8c_e4a9_f3dc_fcde_9856b037d975 -->|defined in| ebe0ae48_a62b_a38f_5bac_5bbbd96fc508 style 8aaeed8c_e4a9_f3dc_fcde_9856b037d975 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
context_test.go lines 2461–2478
func TestContextBadAutoShouldBind(t *testing.T) {
w := httptest.NewRecorder()
c, _ := CreateTestContext(w)
c.Request, _ = http.NewRequest(http.MethodPost, "http://example.com", strings.NewReader(`"foo":"bar", "bar":"foo"}`))
c.Request.Header.Add("Content-Type", MIMEJSON)
var obj struct {
Foo string `json:"foo"`
Bar string `json:"bar"`
}
assert.False(t, c.IsAborted())
require.Error(t, c.ShouldBind(&obj))
assert.Empty(t, obj.Bar)
assert.Empty(t, obj.Foo)
assert.False(t, c.IsAborted())
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does TestContextBadAutoShouldBind() do?
TestContextBadAutoShouldBind() is a function in the gin codebase, defined in context_test.go.
Where is TestContextBadAutoShouldBind() defined?
TestContextBadAutoShouldBind() is defined in context_test.go at line 2461.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free