Home / Function/ TestMethodNotAllowedNoRoute() — gin Function Reference

TestMethodNotAllowedNoRoute() — gin Function Reference

Architecture documentation for the TestMethodNotAllowedNoRoute() function in gin_test.go from the gin codebase.

Entity Profile

Relationship Graph

Source Code

gin_test.go lines 979–987

func TestMethodNotAllowedNoRoute(t *testing.T) {
	g := New()
	g.HandleMethodNotAllowed = true

	req := httptest.NewRequest(http.MethodGet, "/", nil)
	resp := httptest.NewRecorder()
	assert.NotPanics(t, func() { g.ServeHTTP(resp, req) })
	assert.Equal(t, http.StatusNotFound, resp.Code)
}

Domain

Subdomains

Analyze Your Own Codebase

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

Try Supermodel Free