Home / Function/ TestJSONBindingBindBodyMap() — gin Function Reference

TestJSONBindingBindBodyMap() — gin Function Reference

Architecture documentation for the TestJSONBindingBindBodyMap() function in json_test.go from the gin codebase.

Entity Profile

Relationship Graph

Source Code

binding/json_test.go lines 31–38

func TestJSONBindingBindBodyMap(t *testing.T) {
	s := make(map[string]string)
	err := jsonBinding{}.BindBody([]byte(`{"foo": "FOO","hello":"world"}`), &s)
	require.NoError(t, err)
	assert.Len(t, s, 2)
	assert.Equal(t, "FOO", s["foo"])
	assert.Equal(t, "world", s["hello"])
}

Domain

Subdomains

Analyze Your Own Codebase

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

Try Supermodel Free