Home / Function/ TestContextWithFallbackDoneFromRequestContext() — gin Function Reference

TestContextWithFallbackDoneFromRequestContext() — gin Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

context_test.go lines 3140–3156

func TestContextWithFallbackDoneFromRequestContext(t *testing.T) {
	c, _ := CreateTestContext(httptest.NewRecorder())
	// enable ContextWithFallback feature flag
	c.engine.ContextWithFallback = true

	assert.Nil(t, c.Done())

	c2, _ := CreateTestContext(httptest.NewRecorder())
	// enable ContextWithFallback feature flag
	c2.engine.ContextWithFallback = true

	c2.Request, _ = http.NewRequest(http.MethodGet, "/", nil)
	ctx, cancel := context.WithCancel(context.Background())
	c2.Request = c2.Request.WithContext(ctx)
	cancel()
	assert.NotNil(t, <-c2.Done())
}

Domain

Subdomains

Defined In

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free