Home / File/ xml_test.go — gin Source File

xml_test.go — gin Source File

Architecture documentation for xml_test.go, a go file in the gin codebase. 1 imports, 0 dependents.

File go RequestBinding FormBinding 1 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  9b14f5fa_5262_44b1_edb8_65be9c4d447d["xml_test.go"]
  0ff88466_66bc_01d5_630e_e073ff70cccb["testing"]
  9b14f5fa_5262_44b1_edb8_65be9c4d447d --> 0ff88466_66bc_01d5_630e_e073ff70cccb
  style 9b14f5fa_5262_44b1_edb8_65be9c4d447d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

// Copyright 2019 Gin Core Team. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.

package binding

import (
	"testing"

	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
)

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)
}

Subdomains

Types

Dependencies

  • testing

Frequently Asked Questions

What does xml_test.go do?
xml_test.go is a source file in the gin codebase, written in go. It belongs to the RequestBinding domain, FormBinding subdomain.
What functions are defined in xml_test.go?
xml_test.go defines 1 function(s): TestXMLBindingBindBody.
What does xml_test.go depend on?
xml_test.go imports 1 module(s): testing.
Where is xml_test.go in the architecture?
xml_test.go is located at binding/xml_test.go (domain: RequestBinding, subdomain: FormBinding, directory: binding).

Analyze Your Own Codebase

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

Try Supermodel Free