Home / Function/ TestContextTypedError() — gin Function Reference

TestContextTypedError() — gin Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

context_test.go lines 1921–1933

func TestContextTypedError(t *testing.T) {
	c, _ := CreateTestContext(httptest.NewRecorder())
	c.Error(errors.New("externo 0")).SetType(ErrorTypePublic)  //nolint: errcheck
	c.Error(errors.New("interno 0")).SetType(ErrorTypePrivate) //nolint: errcheck

	for _, err := range c.Errors.ByType(ErrorTypePublic) {
		assert.Equal(t, ErrorTypePublic, err.Type)
	}
	for _, err := range c.Errors.ByType(ErrorTypePrivate) {
		assert.Equal(t, ErrorTypePrivate, err.Type)
	}
	assert.Equal(t, []string{"externo 0", "interno 0"}, c.Errors.Errors())
}

Domain

Subdomains

Defined In

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free