Home / Function/ TestStaticFS() — gin Function Reference

TestStaticFS() — gin Function Reference

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

Entity Profile

Relationship Graph

Source Code

ginS/gins_test.go lines 237–246

func TestStaticFS(t *testing.T) {
	fs := http.Dir("../testdata")
	StaticFS("/static-fs", fs)

	req := httptest.NewRequest(http.MethodGet, "/static-fs/test_file.txt", 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