2021-01-16 16:16:26 +03:00
|
|
|
package json_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"bytes"
|
2021-11-25 14:22:04 +03:00
|
|
|
"fmt"
|
2021-01-16 16:16:26 +03:00
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/goccy/go-json"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestCoverFloat32(t *testing.T) {
|
|
|
|
type structFloat32 struct {
|
|
|
|
A float32 `json:"a"`
|
|
|
|
}
|
2021-01-19 14:41:14 +03:00
|
|
|
type structFloat32OmitEmpty struct {
|
|
|
|
A float32 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
type structFloat32String struct {
|
|
|
|
A float32 `json:"a,string"`
|
|
|
|
}
|
2021-05-08 16:38:38 +03:00
|
|
|
type structFloat32StringOmitEmpty struct {
|
|
|
|
A float32 `json:"a,string,omitempty"`
|
|
|
|
}
|
2021-01-19 14:41:14 +03:00
|
|
|
|
2021-01-16 16:16:26 +03:00
|
|
|
type structFloat32Ptr struct {
|
|
|
|
A *float32 `json:"a"`
|
|
|
|
}
|
2021-01-19 14:41:14 +03:00
|
|
|
type structFloat32PtrOmitEmpty struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
type structFloat32PtrString struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
}
|
2021-05-08 16:38:38 +03:00
|
|
|
type structFloat32PtrStringOmitEmpty struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
}
|
2021-01-16 16:16:26 +03:00
|
|
|
|
|
|
|
tests := []struct {
|
2021-02-15 05:29:42 +03:00
|
|
|
name string
|
|
|
|
data interface{}
|
2021-01-16 16:16:26 +03:00
|
|
|
}{
|
2021-03-19 17:31:29 +03:00
|
|
|
{
|
|
|
|
name: "Float32",
|
|
|
|
data: float32(10),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Float32Ptr",
|
|
|
|
data: float32ptr(10),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Float32Ptr3",
|
|
|
|
data: float32ptr3(10),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Float32PtrNil",
|
|
|
|
data: (*float32)(nil),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Float32Ptr3Nil",
|
|
|
|
data: (***float32)(nil),
|
|
|
|
},
|
|
|
|
|
2021-01-19 14:41:14 +03:00
|
|
|
// HeadFloat32Zero
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32Zero",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A float32 `json:"a"`
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32ZeroOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A float32 `json:"a,omitempty"`
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32ZeroString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A float32 `json:"a,string"`
|
|
|
|
}{},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "HeadFloat32ZeroStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A float32 `json:"a,string,omitempty"`
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// HeadFloat32
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A float32 `json:"a"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32OmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A float32 `json:"a,omitempty"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32String",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A float32 `json:"a,string"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "HeadFloat32StringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A float32 `json:"a,string,omitempty"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// HeadFloat32Ptr
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32Ptr",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A *float32 `json:"a"`
|
|
|
|
}{A: float32ptr(1)},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32PtrOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
}{A: float32ptr(1)},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32PtrString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
}{A: float32ptr(1)},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "HeadFloat32PtrStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
}{A: float32ptr(1)},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// HeadFloat32PtrNil
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32PtrNil",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A *float32 `json:"a"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32PtrNilOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32PtrNilString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "HeadFloat32PtrNilStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat32Zero
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32Zero",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A float32 `json:"a"`
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32ZeroOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A float32 `json:"a,omitempty"`
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32ZeroString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A float32 `json:"a,string"`
|
|
|
|
}{},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat32ZeroStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A float32 `json:"a,string,omitempty"`
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat32
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A float32 `json:"a"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32OmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A float32 `json:"a,omitempty"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32String",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A float32 `json:"a,string"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat32StringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A float32 `json:"a,string,omitempty"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat32Ptr
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32Ptr",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *float32 `json:"a"`
|
|
|
|
}{A: float32ptr(1)},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32PtrOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
}{A: float32ptr(1)},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32PtrString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
}{A: float32ptr(1)},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat32PtrStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
}{A: float32ptr(1)},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat32PtrNil
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32PtrNil",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *float32 `json:"a"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32PtrNilOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32PtrNilString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat32PtrNilStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat32Nil
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32Nil",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *float32 `json:"a"`
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32NilOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32NilString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat32NilStringOmitEmpty",
|
|
|
|
data: (*struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// HeadFloat32ZeroMultiFields
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32ZeroMultiFields",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A float32 `json:"a"`
|
|
|
|
B float32 `json:"b"`
|
2021-02-15 05:29:42 +03:00
|
|
|
C float32 `json:"c"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32ZeroMultiFieldsOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A float32 `json:"a,omitempty"`
|
|
|
|
B float32 `json:"b,omitempty"`
|
2021-02-15 05:29:42 +03:00
|
|
|
C float32 `json:"c,omitempty"`
|
2021-01-19 14:41:14 +03:00
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-05-08 16:38:38 +03:00
|
|
|
name: "HeadFloat32ZeroMultiFieldsString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A float32 `json:"a,string"`
|
|
|
|
B float32 `json:"b,string"`
|
2021-02-15 05:29:42 +03:00
|
|
|
C float32 `json:"c,string"`
|
2021-01-19 14:41:14 +03:00
|
|
|
}{},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "HeadFloat32ZeroMultiFieldsStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A float32 `json:"a,string,omitempty"`
|
|
|
|
B float32 `json:"b,string,omitempty"`
|
|
|
|
C float32 `json:"c,string,omitempty"`
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// HeadFloat32MultiFields
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32MultiFields",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A float32 `json:"a"`
|
|
|
|
B float32 `json:"b"`
|
2021-02-15 05:29:42 +03:00
|
|
|
C float32 `json:"c"`
|
|
|
|
}{A: 1, B: 2, C: 3},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32MultiFieldsOmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float32 `json:"a,omitempty"`
|
|
|
|
B float32 `json:"b,omitempty"`
|
2021-02-15 05:29:42 +03:00
|
|
|
C float32 `json:"c,omitempty"`
|
|
|
|
}{A: 1, B: 2, C: 3},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32MultiFieldsString",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float32 `json:"a,string"`
|
|
|
|
B float32 `json:"b,string"`
|
2021-02-15 05:29:42 +03:00
|
|
|
C float32 `json:"c,string"`
|
|
|
|
}{A: 1, B: 2, C: 3},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "HeadFloat32MultiFieldsStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A float32 `json:"a,string,omitempty"`
|
|
|
|
B float32 `json:"b,string,omitempty"`
|
|
|
|
C float32 `json:"c,string,omitempty"`
|
|
|
|
}{A: 1, B: 2, C: 3},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// HeadFloat32PtrMultiFields
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32PtrMultiFields",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *float32 `json:"a"`
|
|
|
|
B *float32 `json:"b"`
|
2021-02-15 05:29:42 +03:00
|
|
|
C *float32 `json:"c"`
|
|
|
|
}{A: float32ptr(1), B: float32ptr(2), C: float32ptr(3)},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32PtrMultiFieldsOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
B *float32 `json:"b,omitempty"`
|
2021-02-15 05:29:42 +03:00
|
|
|
C *float32 `json:"c,omitempty"`
|
|
|
|
}{A: float32ptr(1), B: float32ptr(2), C: float32ptr(3)},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32PtrMultiFieldsString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
B *float32 `json:"b,string"`
|
2021-02-15 05:29:42 +03:00
|
|
|
C *float32 `json:"c,string"`
|
|
|
|
}{A: float32ptr(1), B: float32ptr(2), C: float32ptr(3)},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "HeadFloat32PtrMultiFieldsStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
B *float32 `json:"b,string,omitempty"`
|
|
|
|
C *float32 `json:"c,string,omitempty"`
|
|
|
|
}{A: float32ptr(1), B: float32ptr(2), C: float32ptr(3)},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// HeadFloat32PtrNilMultiFields
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32PtrNilMultiFields",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A *float32 `json:"a"`
|
|
|
|
B *float32 `json:"b"`
|
2021-02-15 05:29:42 +03:00
|
|
|
C *float32 `json:"c"`
|
|
|
|
}{A: nil, B: nil, C: nil},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32PtrNilMultiFieldsOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
B *float32 `json:"b,omitempty"`
|
2021-02-15 05:29:42 +03:00
|
|
|
C *float32 `json:"c,omitempty"`
|
|
|
|
}{A: nil, B: nil, C: nil},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32PtrNilMultiFieldsString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
B *float32 `json:"b,string"`
|
2021-02-15 05:29:42 +03:00
|
|
|
C *float32 `json:"c,string"`
|
|
|
|
}{A: nil, B: nil, C: nil},
|
2021-01-19 14:41:14 +03:00
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "HeadFloat32PtrNilMultiFieldsStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
B *float32 `json:"b,string,omitempty"`
|
|
|
|
C *float32 `json:"c,string,omitempty"`
|
|
|
|
}{A: nil, B: nil, C: nil},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat32ZeroMultiFields
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32ZeroMultiFields",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A float32 `json:"a"`
|
|
|
|
B float32 `json:"b"`
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32ZeroMultiFieldsOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A float32 `json:"a,omitempty"`
|
|
|
|
B float32 `json:"b,omitempty"`
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32ZeroMultiFieldsString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A float32 `json:"a,string"`
|
|
|
|
B float32 `json:"b,string"`
|
|
|
|
}{},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat32ZeroMultiFieldsStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A float32 `json:"a,string,omitempty"`
|
|
|
|
B float32 `json:"b,string,omitempty"`
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat32MultiFields
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32MultiFields",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A float32 `json:"a"`
|
|
|
|
B float32 `json:"b"`
|
|
|
|
}{A: 1, B: 2},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32MultiFieldsOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A float32 `json:"a,omitempty"`
|
|
|
|
B float32 `json:"b,omitempty"`
|
|
|
|
}{A: 1, B: 2},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32MultiFieldsString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A float32 `json:"a,string"`
|
|
|
|
B float32 `json:"b,string"`
|
|
|
|
}{A: 1, B: 2},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat32MultiFieldsStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A float32 `json:"a,string,omitempty"`
|
|
|
|
B float32 `json:"b,string,omitempty"`
|
|
|
|
}{A: 1, B: 2},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat32PtrMultiFields
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32PtrMultiFields",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *float32 `json:"a"`
|
|
|
|
B *float32 `json:"b"`
|
|
|
|
}{A: float32ptr(1), B: float32ptr(2)},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32PtrMultiFieldsOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
B *float32 `json:"b,omitempty"`
|
|
|
|
}{A: float32ptr(1), B: float32ptr(2)},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32PtrMultiFieldsString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
B *float32 `json:"b,string"`
|
|
|
|
}{A: float32ptr(1), B: float32ptr(2)},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat32PtrMultiFieldsStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
B *float32 `json:"b,string,omitempty"`
|
|
|
|
}{A: float32ptr(1), B: float32ptr(2)},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat32PtrNilMultiFields
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32PtrNilMultiFields",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *float32 `json:"a"`
|
|
|
|
B *float32 `json:"b"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32PtrNilMultiFieldsOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
B *float32 `json:"b,omitempty"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32PtrNilMultiFieldsString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
B *float32 `json:"b,string"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat32PtrNilMultiFieldsStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
B *float32 `json:"b,string,omitempty"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat32NilMultiFields
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32NilMultiFields",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *float32 `json:"a"`
|
|
|
|
B *float32 `json:"b"`
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32NilMultiFieldsOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
B *float32 `json:"b,omitempty"`
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32NilMultiFieldsString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
B *float32 `json:"b,string"`
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat32NilMultiFieldsStringOmitEmpty",
|
|
|
|
data: (*struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
B *float32 `json:"b,string,omitempty"`
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// HeadFloat32ZeroNotRoot
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32ZeroNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A float32 `json:"a"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32ZeroNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A float32 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32ZeroNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A float32 `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "HeadFloat32ZeroNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A float32 `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// HeadFloat32NotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32NotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A float32 `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A float32 `json:"a"`
|
|
|
|
}{A: 1}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32NotRootOmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float32 `json:"a,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{A: struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float32 `json:"a,omitempty"`
|
|
|
|
}{A: 1}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32NotRootString",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float32 `json:"a,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 14:41:14 +03:00
|
|
|
}{A: struct {
|
|
|
|
A float32 `json:"a,string"`
|
|
|
|
}{A: 1}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "HeadFloat32NotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A float32 `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A float32 `json:"a,string,omitempty"`
|
|
|
|
}{A: 1}},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// HeadFloat32PtrNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32PtrNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A struct {
|
|
|
|
A *float32 `json:"a"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 14:41:14 +03:00
|
|
|
}{A: struct {
|
|
|
|
A *float32 `json:"a"`
|
|
|
|
}{float32ptr(1)}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32PtrNotRootOmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 14:41:14 +03:00
|
|
|
}{A: struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
}{float32ptr(1)}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32PtrNotRootString",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A struct {
|
|
|
|
A *float32 `json:"a,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 14:41:14 +03:00
|
|
|
}{A: struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
}{float32ptr(1)}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "HeadFloat32PtrNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
}{float32ptr(1)}},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// HeadFloat32PtrNilNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32PtrNilNotRoot",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *float32 `json:"a"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32PtrNilNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32PtrNilNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "HeadFloat32PtrNilNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat32ZeroNotRoot
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32ZeroNotRoot",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A float32 `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: new(struct {
|
|
|
|
A float32 `json:"a"`
|
|
|
|
})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32ZeroNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A float32 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: new(struct {
|
|
|
|
A float32 `json:"a,omitempty"`
|
|
|
|
})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32ZeroNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A float32 `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{A: new(struct {
|
|
|
|
A float32 `json:"a,string"`
|
|
|
|
})},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat32ZeroNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A float32 `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: new(struct {
|
|
|
|
A float32 `json:"a,string,omitempty"`
|
|
|
|
})},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat32NotRoot
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32NotRoot",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A float32 `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A float32 `json:"a"`
|
|
|
|
}{A: 1})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32NotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A float32 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A float32 `json:"a,omitempty"`
|
|
|
|
}{A: 1})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32NotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A float32 `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A float32 `json:"a,string"`
|
|
|
|
}{A: 1})},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat32NotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A float32 `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A float32 `json:"a,string,omitempty"`
|
|
|
|
}{A: 1})},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat32PtrNotRoot
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32PtrNotRoot",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *float32 `json:"a"`
|
|
|
|
}{A: float32ptr(1)})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32PtrNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
}{A: float32ptr(1)})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32PtrNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
}{A: float32ptr(1)})},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat32PtrNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
}{A: float32ptr(1)})},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat32PtrNilNotRoot
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32PtrNilNotRoot",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *float32 `json:"a"`
|
|
|
|
}{A: nil})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32PtrNilNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
}{A: nil})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32PtrNilNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
}{A: nil})},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat32PtrNilNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
}{A: nil})},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat32NilNotRoot
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32NilNotRoot",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32NilNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32NilNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
} `json:",string"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat32NilNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
} `json:",string,omitempty"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// HeadFloat32ZeroMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32ZeroMultiFieldsNotRoot",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A float32 `json:"a"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B float32 `json:"b"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32ZeroMultiFieldsNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A float32 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B float32 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32ZeroMultiFieldsNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A float32 `json:"a,string"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B float32 `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "HeadFloat32ZeroMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A float32 `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B float32 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// HeadFloat32MultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32MultiFieldsNotRoot",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A float32 `json:"a"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B float32 `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A float32 `json:"a"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B float32 `json:"b"`
|
|
|
|
}{B: 2}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32MultiFieldsNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A float32 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B float32 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A float32 `json:"a,omitempty"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B float32 `json:"b,omitempty"`
|
|
|
|
}{B: 2}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32MultiFieldsNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A float32 `json:"a,string"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B float32 `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A float32 `json:"a,string"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B float32 `json:"b,string"`
|
|
|
|
}{B: 2}},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "HeadFloat32MultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A float32 `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B float32 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A float32 `json:"a,string,omitempty"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B float32 `json:"b,string,omitempty"`
|
|
|
|
}{B: 2}},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// HeadFloat32PtrMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32PtrMultiFieldsNotRoot",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *float32 `json:"a"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *float32 `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *float32 `json:"a"`
|
|
|
|
}{A: float32ptr(1)}, B: struct {
|
|
|
|
B *float32 `json:"b"`
|
|
|
|
}{B: float32ptr(2)}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32PtrMultiFieldsNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *float32 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
}{A: float32ptr(1)}, B: struct {
|
|
|
|
B *float32 `json:"b,omitempty"`
|
|
|
|
}{B: float32ptr(2)}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32PtrMultiFieldsNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *float32 `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
}{A: float32ptr(1)}, B: struct {
|
|
|
|
B *float32 `json:"b,string"`
|
|
|
|
}{B: float32ptr(2)}},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "HeadFloat32PtrMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *float32 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
}{A: float32ptr(1)}, B: struct {
|
|
|
|
B *float32 `json:"b,string,omitempty"`
|
|
|
|
}{B: float32ptr(2)}},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// HeadFloat32PtrNilMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32PtrNilMultiFieldsNotRoot",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *float32 `json:"a"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *float32 `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *float32 `json:"a"`
|
|
|
|
}{A: nil}, B: struct {
|
|
|
|
B *float32 `json:"b"`
|
|
|
|
}{B: nil}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32PtrNilMultiFieldsNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *float32 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
}{A: nil}, B: struct {
|
|
|
|
B *float32 `json:"b,omitempty"`
|
|
|
|
}{B: nil}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "HeadFloat32PtrNilMultiFieldsNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *float32 `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
}{A: nil}, B: struct {
|
|
|
|
B *float32 `json:"b,string"`
|
|
|
|
}{B: nil}},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "HeadFloat32PtrNilMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *float32 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
}{A: nil}, B: struct {
|
|
|
|
B *float32 `json:"b,string,omitempty"`
|
|
|
|
}{B: nil}},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat32ZeroMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32ZeroMultiFieldsNotRoot",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A struct {
|
|
|
|
A float32 `json:"a"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 14:41:14 +03:00
|
|
|
B struct {
|
|
|
|
B float32 `json:"b"`
|
|
|
|
}
|
|
|
|
}{},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32ZeroMultiFieldsNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A struct {
|
|
|
|
A float32 `json:"a,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 14:41:14 +03:00
|
|
|
B struct {
|
|
|
|
B float32 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32ZeroMultiFieldsNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float32 `json:"a,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
B float32 `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat32ZeroMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A struct {
|
|
|
|
A float32 `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B float32 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat32MultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32MultiFieldsNotRoot",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A struct {
|
|
|
|
A float32 `json:"a"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B float32 `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A float32 `json:"a"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B float32 `json:"b"`
|
|
|
|
}{B: 2}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32MultiFieldsNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float32 `json:"a,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
B float32 `json:"b,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{A: struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float32 `json:"a,omitempty"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B float32 `json:"b,omitempty"`
|
|
|
|
}{B: 2}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32MultiFieldsNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float32 `json:"a,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
B float32 `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{A: struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float32 `json:"a,string"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B float32 `json:"b,string"`
|
|
|
|
}{B: 2}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat32MultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A struct {
|
|
|
|
A float32 `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B float32 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A float32 `json:"a,string,omitempty"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B float32 `json:"b,string,omitempty"`
|
|
|
|
}{B: 2}},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat32PtrMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32PtrMultiFieldsNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 14:41:14 +03:00
|
|
|
B *struct {
|
|
|
|
B *float32 `json:"b"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 14:41:14 +03:00
|
|
|
}{A: &(struct {
|
|
|
|
A *float32 `json:"a"`
|
|
|
|
}{A: float32ptr(1)}), B: &(struct {
|
|
|
|
B *float32 `json:"b"`
|
|
|
|
}{B: float32ptr(2)})},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32PtrMultiFieldsNotRootOmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *float32 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
}{A: float32ptr(1)}), B: &(struct {
|
|
|
|
B *float32 `json:"b,omitempty"`
|
|
|
|
}{B: float32ptr(2)})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32PtrMultiFieldsNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *float32 `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
}{A: float32ptr(1)}), B: &(struct {
|
|
|
|
B *float32 `json:"b,string"`
|
|
|
|
}{B: float32ptr(2)})},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat32PtrMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *float32 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
}{A: float32ptr(1)}), B: &(struct {
|
|
|
|
B *float32 `json:"b,string,omitempty"`
|
|
|
|
}{B: float32ptr(2)})},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat32PtrNilMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32PtrNilMultiFieldsNotRoot",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *float32 `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32PtrNilMultiFieldsNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
B *struct {
|
|
|
|
B *float32 `json:"b,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32PtrNilMultiFieldsNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
} `json:",string"`
|
|
|
|
B *struct {
|
|
|
|
B *float32 `json:"b,string"`
|
|
|
|
} `json:",string"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat32PtrNilMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
} `json:",string,omitempty"`
|
|
|
|
B *struct {
|
|
|
|
B *float32 `json:"b,string,omitempty"`
|
|
|
|
} `json:",string,omitempty"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat32NilMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32NilMultiFieldsNotRoot",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *float32 `json:"b"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32NilMultiFieldsNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *float32 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32NilMultiFieldsNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *float32 `json:"b,string"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat32NilMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *float32 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat32DoubleMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32DoubleMultiFieldsNotRoot",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A float32 `json:"a"`
|
2021-01-19 14:41:14 +03:00
|
|
|
B float32 `json:"b"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 14:41:14 +03:00
|
|
|
B *struct {
|
|
|
|
A float32 `json:"a"`
|
2021-01-16 16:16:26 +03:00
|
|
|
B float32 `json:"b"`
|
|
|
|
}
|
2021-01-19 14:41:14 +03:00
|
|
|
}{A: &(struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A float32 `json:"a"`
|
|
|
|
B float32 `json:"b"`
|
2021-01-19 14:41:14 +03:00
|
|
|
}{A: 1, B: 2}), B: &(struct {
|
|
|
|
A float32 `json:"a"`
|
|
|
|
B float32 `json:"b"`
|
|
|
|
}{A: 3, B: 4})},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32DoubleMultiFieldsNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A float32 `json:"a,omitempty"`
|
|
|
|
B float32 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A float32 `json:"a,omitempty"`
|
|
|
|
B float32 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A float32 `json:"a,omitempty"`
|
|
|
|
B float32 `json:"b,omitempty"`
|
|
|
|
}{A: 1, B: 2}), B: &(struct {
|
|
|
|
A float32 `json:"a,omitempty"`
|
|
|
|
B float32 `json:"b,omitempty"`
|
|
|
|
}{A: 3, B: 4})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32DoubleMultiFieldsNotRootString",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float32 `json:"a,string"`
|
|
|
|
B float32 `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B *struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float32 `json:"a,string"`
|
|
|
|
B float32 `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{A: &(struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float32 `json:"a,string"`
|
|
|
|
B float32 `json:"b,string"`
|
|
|
|
}{A: 1, B: 2}), B: &(struct {
|
|
|
|
A float32 `json:"a,string"`
|
|
|
|
B float32 `json:"b,string"`
|
|
|
|
}{A: 3, B: 4})},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat32DoubleMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A float32 `json:"a,string,omitempty"`
|
|
|
|
B float32 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A float32 `json:"a,string,omitempty"`
|
|
|
|
B float32 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A float32 `json:"a,string,omitempty"`
|
|
|
|
B float32 `json:"b,string,omitempty"`
|
|
|
|
}{A: 1, B: 2}), B: &(struct {
|
|
|
|
A float32 `json:"a,string,omitempty"`
|
|
|
|
B float32 `json:"b,string,omitempty"`
|
|
|
|
}{A: 3, B: 4})},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat32NilDoubleMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32NilDoubleMultiFieldsNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float32 `json:"a"`
|
|
|
|
B float32 `json:"b"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B *struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float32 `json:"a"`
|
|
|
|
B float32 `json:"b"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32NilDoubleMultiFieldsNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A *struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float32 `json:"a,omitempty"`
|
|
|
|
B float32 `json:"b,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
B *struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float32 `json:"a,omitempty"`
|
|
|
|
B float32 `json:"b,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
}{A: nil, B: nil},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32NilDoubleMultiFieldsNotRootString",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float32 `json:"a,string"`
|
|
|
|
B float32 `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B *struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float32 `json:"a,string"`
|
|
|
|
B float32 `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 14:41:14 +03:00
|
|
|
}{A: nil, B: nil},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat32NilDoubleMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A float32 `json:"a,string,omitempty"`
|
|
|
|
B float32 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A float32 `json:"a,string,omitempty"`
|
|
|
|
B float32 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat32NilDoubleMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32NilDoubleMultiFieldsNotRoot",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: (*struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A *struct {
|
|
|
|
A float32 `json:"a"`
|
|
|
|
B float32 `json:"b"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A float32 `json:"a"`
|
|
|
|
B float32 `json:"b"`
|
|
|
|
}
|
2021-01-19 14:41:14 +03:00
|
|
|
})(nil),
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32NilDoubleMultiFieldsNotRootOmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float32 `json:"a,omitempty"`
|
|
|
|
B float32 `json:"b,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B *struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float32 `json:"a,omitempty"`
|
|
|
|
B float32 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32NilDoubleMultiFieldsNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A float32 `json:"a,string"`
|
|
|
|
B float32 `json:"b,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A float32 `json:"a,string"`
|
|
|
|
B float32 `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat32NilDoubleMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A float32 `json:"a,string,omitempty"`
|
|
|
|
B float32 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A float32 `json:"a,string,omitempty"`
|
|
|
|
B float32 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat32PtrDoubleMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32PtrDoubleMultiFieldsNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a"`
|
|
|
|
B *float32 `json:"b"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *float32 `json:"a"`
|
|
|
|
B *float32 `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *float32 `json:"a"`
|
|
|
|
B *float32 `json:"b"`
|
|
|
|
}{A: float32ptr(1), B: float32ptr(2)}), B: &(struct {
|
|
|
|
A *float32 `json:"a"`
|
|
|
|
B *float32 `json:"b"`
|
|
|
|
}{A: float32ptr(3), B: float32ptr(4)})},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32PtrDoubleMultiFieldsNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
B *float32 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
B *float32 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
B *float32 `json:"b,omitempty"`
|
|
|
|
}{A: float32ptr(1), B: float32ptr(2)}), B: &(struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
B *float32 `json:"b,omitempty"`
|
|
|
|
}{A: float32ptr(3), B: float32ptr(4)})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32PtrDoubleMultiFieldsNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
B *float32 `json:"b,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
B *float32 `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
B *float32 `json:"b,string"`
|
|
|
|
}{A: float32ptr(1), B: float32ptr(2)}), B: &(struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
B *float32 `json:"b,string"`
|
|
|
|
}{A: float32ptr(3), B: float32ptr(4)})},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat32PtrDoubleMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
B *float32 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
B *float32 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
B *float32 `json:"b,string,omitempty"`
|
|
|
|
}{A: float32ptr(1), B: float32ptr(2)}), B: &(struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
B *float32 `json:"b,string,omitempty"`
|
|
|
|
}{A: float32ptr(3), B: float32ptr(4)})},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat32PtrNilDoubleMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32PtrNilDoubleMultiFieldsNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a"`
|
|
|
|
B *float32 `json:"b"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *float32 `json:"a"`
|
|
|
|
B *float32 `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32PtrNilDoubleMultiFieldsNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
B *float32 `json:"b,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
B *struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
B *float32 `json:"b,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32PtrNilDoubleMultiFieldsNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
B *float32 `json:"b,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
B *float32 `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat32PtrNilDoubleMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
B *float32 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
B *float32 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat32PtrNilDoubleMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32PtrNilDoubleMultiFieldsNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a"`
|
|
|
|
B *float32 `json:"b"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *float32 `json:"a"`
|
|
|
|
B *float32 `json:"b"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32PtrNilDoubleMultiFieldsNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
B *float32 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *float32 `json:"a,omitempty"`
|
|
|
|
B *float32 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrHeadFloat32PtrNilDoubleMultiFieldsNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
B *float32 `json:"b,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *float32 `json:"a,string"`
|
|
|
|
B *float32 `json:"b,string"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat32PtrNilDoubleMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
B *float32 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *float32 `json:"a,string,omitempty"`
|
|
|
|
B *float32 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// AnonymousHeadFloat32
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "AnonymousHeadFloat32",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat32
|
|
|
|
B float32 `json:"b"`
|
|
|
|
}{
|
|
|
|
structFloat32: structFloat32{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "AnonymousHeadFloat32OmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat32OmitEmpty
|
|
|
|
B float32 `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structFloat32OmitEmpty: structFloat32OmitEmpty{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "AnonymousHeadFloat32String",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat32String
|
|
|
|
B float32 `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structFloat32String: structFloat32String{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "AnonymousHeadFloat32StringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
structFloat32StringOmitEmpty
|
|
|
|
B float32 `json:"b,string,omitempty"`
|
|
|
|
}{
|
|
|
|
structFloat32StringOmitEmpty: structFloat32StringOmitEmpty{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrAnonymousHeadFloat32
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrAnonymousHeadFloat32",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat32
|
|
|
|
B float32 `json:"b"`
|
|
|
|
}{
|
|
|
|
structFloat32: &structFloat32{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrAnonymousHeadFloat32OmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat32OmitEmpty
|
|
|
|
B float32 `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structFloat32OmitEmpty: &structFloat32OmitEmpty{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrAnonymousHeadFloat32String",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat32String
|
|
|
|
B float32 `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structFloat32String: &structFloat32String{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "PtrAnonymousHeadFloat32StringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
*structFloat32StringOmitEmpty
|
|
|
|
B float32 `json:"b,string,omitempty"`
|
|
|
|
}{
|
|
|
|
structFloat32StringOmitEmpty: &structFloat32StringOmitEmpty{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// NilPtrAnonymousHeadFloat32
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "NilPtrAnonymousHeadFloat32",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
*structFloat32
|
2021-01-16 16:16:26 +03:00
|
|
|
B float32 `json:"b"`
|
|
|
|
}{
|
2021-01-19 14:41:14 +03:00
|
|
|
structFloat32: nil,
|
2021-01-16 16:16:26 +03:00
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "NilPtrAnonymousHeadFloat32OmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
*structFloat32OmitEmpty
|
|
|
|
B float32 `json:"b,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}{
|
2021-01-19 14:41:14 +03:00
|
|
|
structFloat32OmitEmpty: nil,
|
|
|
|
B: 2,
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "NilPtrAnonymousHeadFloat32String",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
*structFloat32String
|
|
|
|
B float32 `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}{
|
2021-01-19 14:41:14 +03:00
|
|
|
structFloat32String: nil,
|
|
|
|
B: 2,
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "NilPtrAnonymousHeadFloat32StringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
*structFloat32StringOmitEmpty
|
|
|
|
B float32 `json:"b,string,omitempty"`
|
|
|
|
}{
|
|
|
|
structFloat32StringOmitEmpty: nil,
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// AnonymousHeadFloat32Ptr
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "AnonymousHeadFloat32Ptr",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat32Ptr
|
|
|
|
B *float32 `json:"b"`
|
|
|
|
}{
|
|
|
|
structFloat32Ptr: structFloat32Ptr{A: float32ptr(1)},
|
|
|
|
B: float32ptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "AnonymousHeadFloat32PtrOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat32PtrOmitEmpty
|
|
|
|
B *float32 `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structFloat32PtrOmitEmpty: structFloat32PtrOmitEmpty{A: float32ptr(1)},
|
|
|
|
B: float32ptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "AnonymousHeadFloat32PtrString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat32PtrString
|
|
|
|
B *float32 `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structFloat32PtrString: structFloat32PtrString{A: float32ptr(1)},
|
|
|
|
B: float32ptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "AnonymousHeadFloat32PtrStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
structFloat32PtrStringOmitEmpty
|
|
|
|
B *float32 `json:"b,string,omitempty"`
|
|
|
|
}{
|
|
|
|
structFloat32PtrStringOmitEmpty: structFloat32PtrStringOmitEmpty{A: float32ptr(1)},
|
|
|
|
B: float32ptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// AnonymousHeadFloat32PtrNil
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "AnonymousHeadFloat32PtrNil",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat32Ptr
|
|
|
|
B *float32 `json:"b"`
|
|
|
|
}{
|
|
|
|
structFloat32Ptr: structFloat32Ptr{A: nil},
|
|
|
|
B: float32ptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "AnonymousHeadFloat32PtrNilOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat32PtrOmitEmpty
|
|
|
|
B *float32 `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structFloat32PtrOmitEmpty: structFloat32PtrOmitEmpty{A: nil},
|
|
|
|
B: float32ptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "AnonymousHeadFloat32PtrNilString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat32PtrString
|
|
|
|
B *float32 `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structFloat32PtrString: structFloat32PtrString{A: nil},
|
|
|
|
B: float32ptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "AnonymousHeadFloat32PtrNilStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
structFloat32PtrStringOmitEmpty
|
|
|
|
B *float32 `json:"b,string,omitempty"`
|
|
|
|
}{
|
|
|
|
structFloat32PtrStringOmitEmpty: structFloat32PtrStringOmitEmpty{A: nil},
|
|
|
|
B: float32ptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrAnonymousHeadFloat32Ptr
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrAnonymousHeadFloat32Ptr",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat32Ptr
|
|
|
|
B *float32 `json:"b"`
|
|
|
|
}{
|
|
|
|
structFloat32Ptr: &structFloat32Ptr{A: float32ptr(1)},
|
|
|
|
B: float32ptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrAnonymousHeadFloat32PtrOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat32PtrOmitEmpty
|
|
|
|
B *float32 `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structFloat32PtrOmitEmpty: &structFloat32PtrOmitEmpty{A: float32ptr(1)},
|
|
|
|
B: float32ptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrAnonymousHeadFloat32PtrString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat32PtrString
|
|
|
|
B *float32 `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structFloat32PtrString: &structFloat32PtrString{A: float32ptr(1)},
|
|
|
|
B: float32ptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "PtrAnonymousHeadFloat32PtrStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
*structFloat32PtrStringOmitEmpty
|
|
|
|
B *float32 `json:"b,string,omitempty"`
|
|
|
|
}{
|
|
|
|
structFloat32PtrStringOmitEmpty: &structFloat32PtrStringOmitEmpty{A: float32ptr(1)},
|
|
|
|
B: float32ptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// NilPtrAnonymousHeadFloat32Ptr
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "NilPtrAnonymousHeadFloat32Ptr",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat32Ptr
|
|
|
|
B *float32 `json:"b"`
|
|
|
|
}{
|
|
|
|
structFloat32Ptr: nil,
|
|
|
|
B: float32ptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "NilPtrAnonymousHeadFloat32PtrOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat32PtrOmitEmpty
|
|
|
|
B *float32 `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structFloat32PtrOmitEmpty: nil,
|
|
|
|
B: float32ptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "NilPtrAnonymousHeadFloat32PtrString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat32PtrString
|
|
|
|
B *float32 `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structFloat32PtrString: nil,
|
|
|
|
B: float32ptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "NilPtrAnonymousHeadFloat32PtrStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
*structFloat32PtrStringOmitEmpty
|
|
|
|
B *float32 `json:"b,string,omitempty"`
|
|
|
|
}{
|
|
|
|
structFloat32PtrStringOmitEmpty: nil,
|
|
|
|
B: float32ptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// AnonymousHeadFloat32Only
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "AnonymousHeadFloat32Only",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat32
|
|
|
|
}{
|
|
|
|
structFloat32: structFloat32{A: 1},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "AnonymousHeadFloat32OnlyOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat32OmitEmpty
|
|
|
|
}{
|
|
|
|
structFloat32OmitEmpty: structFloat32OmitEmpty{A: 1},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "AnonymousHeadFloat32OnlyString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat32String
|
|
|
|
}{
|
|
|
|
structFloat32String: structFloat32String{A: 1},
|
|
|
|
},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "AnonymousHeadFloat32OnlyStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
structFloat32StringOmitEmpty
|
|
|
|
}{
|
|
|
|
structFloat32StringOmitEmpty: structFloat32StringOmitEmpty{A: 1},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrAnonymousHeadFloat32Only
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrAnonymousHeadFloat32Only",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat32
|
|
|
|
}{
|
|
|
|
structFloat32: &structFloat32{A: 1},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrAnonymousHeadFloat32OnlyOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat32OmitEmpty
|
|
|
|
}{
|
|
|
|
structFloat32OmitEmpty: &structFloat32OmitEmpty{A: 1},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrAnonymousHeadFloat32OnlyString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat32String
|
|
|
|
}{
|
|
|
|
structFloat32String: &structFloat32String{A: 1},
|
|
|
|
},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "PtrAnonymousHeadFloat32OnlyStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
*structFloat32StringOmitEmpty
|
|
|
|
}{
|
|
|
|
structFloat32StringOmitEmpty: &structFloat32StringOmitEmpty{A: 1},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// NilPtrAnonymousHeadFloat32Only
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "NilPtrAnonymousHeadFloat32Only",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat32
|
|
|
|
}{
|
|
|
|
structFloat32: nil,
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "NilPtrAnonymousHeadFloat32OnlyOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat32OmitEmpty
|
|
|
|
}{
|
|
|
|
structFloat32OmitEmpty: nil,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "NilPtrAnonymousHeadFloat32OnlyString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat32String
|
|
|
|
}{
|
|
|
|
structFloat32String: nil,
|
|
|
|
},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "NilPtrAnonymousHeadFloat32OnlyStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
*structFloat32StringOmitEmpty
|
|
|
|
}{
|
|
|
|
structFloat32StringOmitEmpty: nil,
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// AnonymousHeadFloat32PtrOnly
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "AnonymousHeadFloat32PtrOnly",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat32Ptr
|
|
|
|
}{
|
|
|
|
structFloat32Ptr: structFloat32Ptr{A: float32ptr(1)},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "AnonymousHeadFloat32PtrOnlyOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat32PtrOmitEmpty
|
|
|
|
}{
|
|
|
|
structFloat32PtrOmitEmpty: structFloat32PtrOmitEmpty{A: float32ptr(1)},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "AnonymousHeadFloat32PtrOnlyString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat32PtrString
|
|
|
|
}{
|
|
|
|
structFloat32PtrString: structFloat32PtrString{A: float32ptr(1)},
|
|
|
|
},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "AnonymousHeadFloat32PtrOnlyStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
structFloat32PtrStringOmitEmpty
|
|
|
|
}{
|
|
|
|
structFloat32PtrStringOmitEmpty: structFloat32PtrStringOmitEmpty{A: float32ptr(1)},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// AnonymousHeadFloat32PtrNilOnly
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "AnonymousHeadFloat32PtrNilOnly",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat32Ptr
|
|
|
|
}{
|
|
|
|
structFloat32Ptr: structFloat32Ptr{A: nil},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "AnonymousHeadFloat32PtrNilOnlyOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat32PtrOmitEmpty
|
|
|
|
}{
|
|
|
|
structFloat32PtrOmitEmpty: structFloat32PtrOmitEmpty{A: nil},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "AnonymousHeadFloat32PtrNilOnlyString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat32PtrString
|
|
|
|
}{
|
|
|
|
structFloat32PtrString: structFloat32PtrString{A: nil},
|
|
|
|
},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "AnonymousHeadFloat32PtrNilOnlyStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
structFloat32PtrStringOmitEmpty
|
|
|
|
}{
|
|
|
|
structFloat32PtrStringOmitEmpty: structFloat32PtrStringOmitEmpty{A: nil},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrAnonymousHeadFloat32PtrOnly
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrAnonymousHeadFloat32PtrOnly",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat32Ptr
|
|
|
|
}{
|
|
|
|
structFloat32Ptr: &structFloat32Ptr{A: float32ptr(1)},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrAnonymousHeadFloat32PtrOnlyOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat32PtrOmitEmpty
|
|
|
|
}{
|
|
|
|
structFloat32PtrOmitEmpty: &structFloat32PtrOmitEmpty{A: float32ptr(1)},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "PtrAnonymousHeadFloat32PtrOnlyString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat32PtrString
|
|
|
|
}{
|
|
|
|
structFloat32PtrString: &structFloat32PtrString{A: float32ptr(1)},
|
|
|
|
},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "PtrAnonymousHeadFloat32PtrOnlyStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
*structFloat32PtrStringOmitEmpty
|
|
|
|
}{
|
|
|
|
structFloat32PtrStringOmitEmpty: &structFloat32PtrStringOmitEmpty{A: float32ptr(1)},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// NilPtrAnonymousHeadFloat32PtrOnly
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "NilPtrAnonymousHeadFloat32PtrOnly",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat32Ptr
|
|
|
|
}{
|
|
|
|
structFloat32Ptr: nil,
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "NilPtrAnonymousHeadFloat32PtrOnlyOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat32PtrOmitEmpty
|
|
|
|
}{
|
|
|
|
structFloat32PtrOmitEmpty: nil,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:29:42 +03:00
|
|
|
name: "NilPtrAnonymousHeadFloat32PtrOnlyString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat32PtrString
|
|
|
|
}{
|
|
|
|
structFloat32PtrString: nil,
|
|
|
|
},
|
|
|
|
},
|
2021-05-08 16:38:38 +03:00
|
|
|
{
|
|
|
|
name: "NilPtrAnonymousHeadFloat32PtrOnlyStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
*structFloat32PtrStringOmitEmpty
|
|
|
|
}{
|
|
|
|
structFloat32PtrStringOmitEmpty: nil,
|
|
|
|
},
|
|
|
|
},
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
for _, test := range tests {
|
|
|
|
for _, indent := range []bool{true, false} {
|
|
|
|
for _, htmlEscape := range []bool{true, false} {
|
2021-11-25 14:22:04 +03:00
|
|
|
t.Run(fmt.Sprintf("%s_indent_%t_escape_%t", test.name, indent, htmlEscape), func(t *testing.T) {
|
|
|
|
var buf bytes.Buffer
|
|
|
|
enc := json.NewEncoder(&buf)
|
|
|
|
enc.SetEscapeHTML(htmlEscape)
|
|
|
|
if indent {
|
|
|
|
enc.SetIndent("", " ")
|
|
|
|
}
|
|
|
|
if err := enc.Encode(test.data); err != nil {
|
|
|
|
t.Fatalf("%s(htmlEscape:%T): %+v: %s", test.name, htmlEscape, test.data, err)
|
|
|
|
}
|
|
|
|
stdresult := encodeByEncodingJSON(test.data, indent, htmlEscape)
|
|
|
|
if buf.String() != stdresult {
|
|
|
|
t.Errorf("%s(htmlEscape:%T): doesn't compatible with encoding/json. expected %q but got %q", test.name, htmlEscape, stdresult, buf.String())
|
|
|
|
}
|
|
|
|
})
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|