Home / Function/ TestStaticFile() — gin Function Reference

TestStaticFile() — gin Function Reference

Architecture documentation for the TestStaticFile() function in gins_test.go from the gin codebase.

Entity Profile

Relationship Graph

Source Code

ginS/gins_test.go lines 217–225

func TestStaticFile(t *testing.T) {
	StaticFile("/static-file", "../testdata/test_file.txt")

	req := httptest.NewRequest(http.MethodGet, "/static-file", nil)
	w := httptest.NewRecorder()
	engine().ServeHTTP(w, req)

	assert.Equal(t, http.StatusOK, w.Code)
}

Subdomains

Analyze Your Own Codebase

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

Try Supermodel Free