TestContextSetGetValues() — gin Function Reference
Architecture documentation for the TestContextSetGetValues() function in context_test.go from the gin codebase.
Entity Profile
Dependency Diagram
graph TD f2e1be15_a041_2099_fac1_34ba51b350a6["TestContextSetGetValues()"] ebe0ae48_a62b_a38f_5bac_5bbbd96fc508["context_test.go"] f2e1be15_a041_2099_fac1_34ba51b350a6 -->|defined in| ebe0ae48_a62b_a38f_5bac_5bbbd96fc508 style f2e1be15_a041_2099_fac1_34ba51b350a6 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
context_test.go lines 376–394
func TestContextSetGetValues(t *testing.T) {
c, _ := CreateTestContext(httptest.NewRecorder())
c.Set("string", "this is a string")
c.Set("int32", int32(-42))
c.Set("int64", int64(42424242424242))
c.Set("uint64", uint64(42))
c.Set("float32", float32(4.2))
c.Set("float64", 4.2)
var a any = 1
c.Set("intInterface", a)
assert.Exactly(t, "this is a string", c.MustGet("string").(string))
assert.Exactly(t, int32(-42), c.MustGet("int32").(int32))
assert.Exactly(t, int64(42424242424242), c.MustGet("int64").(int64))
assert.Exactly(t, uint64(42), c.MustGet("uint64").(uint64))
assert.InDelta(t, float32(4.2), c.MustGet("float32").(float32), 0.01)
assert.InDelta(t, 4.2, c.MustGet("float64").(float64), 0.01)
assert.Exactly(t, 1, c.MustGet("intInterface").(int))
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does TestContextSetGetValues() do?
TestContextSetGetValues() is a function in the gin codebase, defined in context_test.go.
Where is TestContextSetGetValues() defined?
TestContextSetGetValues() is defined in context_test.go at line 376.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free