Skip to content
Myr

yaml_test.go

This file

Path

binding/yaml_test.go

21 lines · 480 bytes · Go

Last changed by

Not known.

History of this file

Take it

1// Copyright 2019 Gin Core Team. All rights reserved.2// Use of this source code is governed by a MIT style3// license that can be found in the LICENSE file.45package binding67import (8	"testing"910	"github.com/stretchr/testify/assert"11	"github.com/stretchr/testify/require"12)1314func TestYAMLBindingBindBody(t *testing.T) {15	var s struct {16		Foo string `yaml:"foo"`17	}18	err := yamlBinding{}.BindBody([]byte("foo: FOO"), &s)19	require.NoError(t, err)20	assert.Equal(t, "FOO", s.Foo)21}