go-json/decode_test.go

18 lines
271 B
Go
Raw Normal View History

2020-04-22 07:06:52 +03:00
package json_test
import (
"testing"
"github.com/goccy/go-json"
)
func Test_Decoder(t *testing.T) {
t.Run("struct", func(t *testing.T) {
var v struct {
A int
}
assertErr(t, json.Unmarshal([]byte(`{"a":123}`), &v))
assertEq(t, "struct.A", v.A, 123)
})
}