Home / Function/ TestContextSetCookie() — gin Function Reference

TestContextSetCookie() — gin Function Reference

Architecture documentation for the TestContextSetCookie() function in context_test.go from the gin codebase.

Entity Profile

Dependency Diagram

graph TD
  9150bd6b_37af_64cc_f45e_de7f376d80a0["TestContextSetCookie()"]
  ebe0ae48_a62b_a38f_5bac_5bbbd96fc508["context_test.go"]
  9150bd6b_37af_64cc_f45e_de7f376d80a0 -->|defined in| ebe0ae48_a62b_a38f_5bac_5bbbd96fc508
  style 9150bd6b_37af_64cc_f45e_de7f376d80a0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

context_test.go lines 1008–1013

func TestContextSetCookie(t *testing.T) {
	c, _ := CreateTestContext(httptest.NewRecorder())
	c.SetSameSite(http.SameSiteLaxMode)
	c.SetCookie("user", "gin", 1, "/", "localhost", true, true)
	assert.Equal(t, "user=gin; Path=/; Domain=localhost; Max-Age=1; HttpOnly; Secure; SameSite=Lax", c.Writer.Header().Get("Set-Cookie"))
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does TestContextSetCookie() do?
TestContextSetCookie() is a function in the gin codebase, defined in context_test.go.
Where is TestContextSetCookie() defined?
TestContextSetCookie() is defined in context_test.go at line 1008.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free