testFormBindingForTime() — gin Function Reference
Architecture documentation for the testFormBindingForTime() function in binding_test.go from the gin codebase.
Entity Profile
Dependency Diagram
graph TD 07a35e45_ee52_f3fe_ae04_d378e0cf5631["testFormBindingForTime()"] 314c6481_2bd0_e5a7_282c_94e41df6062a["binding_test.go"] 07a35e45_ee52_f3fe_ae04_d378e0cf5631 -->|defined in| 314c6481_2bd0_e5a7_282c_94e41df6062a 15be6698_c30d_961f_f7aa_8ec3e6c4e801["TestBindingFormForTime()"] 15be6698_c30d_961f_f7aa_8ec3e6c4e801 -->|calls| 07a35e45_ee52_f3fe_ae04_d378e0cf5631 d08a46ef_c03c_f22a_c5d3_1b2bb5a48585["TestBindingFormForTime2()"] d08a46ef_c03c_f22a_c5d3_1b2bb5a48585 -->|calls| 07a35e45_ee52_f3fe_ae04_d378e0cf5631 aebd0564_565b_ba1b_7f92_4baaca0e7b7e["requestWithBody()"] 07a35e45_ee52_f3fe_ae04_d378e0cf5631 -->|calls| aebd0564_565b_ba1b_7f92_4baaca0e7b7e style 07a35e45_ee52_f3fe_ae04_d378e0cf5631 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
binding/binding_test.go lines 955–980
func testFormBindingForTime(t *testing.T, method, path, badPath, body, badBody string) {
b := Form
assert.Equal(t, "form", b.Name())
obj := FooBarStructForTimeType{}
req := requestWithBody(method, path, body)
if method == http.MethodPost {
req.Header.Add("Content-Type", MIMEPOSTForm)
}
err := b.Bind(req, &obj)
require.NoError(t, err)
assert.Equal(t, int64(1510675200), obj.TimeFoo.Unix())
assert.Equal(t, "Asia/Chongqing", obj.TimeFoo.Location().String())
assert.Equal(t, int64(-62135596800), obj.TimeBar.Unix())
assert.Equal(t, "UTC", obj.TimeBar.Location().String())
assert.Equal(t, int64(1562400033000000123), obj.CreateTime.UnixNano())
assert.Equal(t, int64(1562400033), obj.UnixTime.Unix())
assert.Equal(t, int64(1562400033001), obj.UnixMilliTime.UnixMilli())
assert.Equal(t, int64(1562400033000012), obj.UnixMicroTime.UnixMicro())
obj = FooBarStructForTimeType{}
req = requestWithBody(method, badPath, badBody)
err = JSON.Bind(req, &obj)
require.Error(t, err)
}
Domain
Subdomains
Defined In
Calls
Source
Frequently Asked Questions
What does testFormBindingForTime() do?
testFormBindingForTime() is a function in the gin codebase, defined in binding/binding_test.go.
Where is testFormBindingForTime() defined?
testFormBindingForTime() is defined in binding/binding_test.go at line 955.
What does testFormBindingForTime() call?
testFormBindingForTime() calls 1 function(s): requestWithBody.
What calls testFormBindingForTime()?
testFormBindingForTime() is called by 2 function(s): TestBindingFormForTime, TestBindingFormForTime2.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free