Home / Function/ TestXMLBindingBindBody() — gin Function Reference

TestXMLBindingBindBody() — gin Function Reference

Architecture documentation for the TestXMLBindingBindBody() function in xml_test.go from the gin codebase.

Entity Profile

Relationship Graph

Source Code

binding/xml_test.go lines 14–25

func TestXMLBindingBindBody(t *testing.T) {
	var s struct {
		Foo string `xml:"foo"`
	}
	xmlBody := `<?xml version="1.0" encoding="UTF-8"?>
<root>
   <foo>FOO</foo>
</root>`
	err := xmlBinding{}.BindBody([]byte(xmlBody), &s)
	require.NoError(t, err)
	assert.Equal(t, "FOO", s.Foo)
}

Domain

Subdomains

Analyze Your Own Codebase

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

Try Supermodel Free