2021-01-16 16:16:26 +03:00
|
|
|
package json_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"bytes"
|
2021-11-27 20:14:57 +03:00
|
|
|
"fmt"
|
2021-01-16 16:16:26 +03:00
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/goccy/go-json"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestCoverFloat64(t *testing.T) {
|
|
|
|
type structFloat64 struct {
|
|
|
|
A float64 `json:"a"`
|
|
|
|
}
|
2021-01-19 14:41:14 +03:00
|
|
|
type structFloat64OmitEmpty struct {
|
|
|
|
A float64 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
type structFloat64String struct {
|
|
|
|
A float64 `json:"a,string"`
|
|
|
|
}
|
2021-05-08 16:41:17 +03:00
|
|
|
type structFloat64StringOmitEmpty struct {
|
|
|
|
A float64 `json:"a,string,omitempty"`
|
|
|
|
}
|
2021-01-19 14:41:14 +03:00
|
|
|
|
2021-01-16 16:16:26 +03:00
|
|
|
type structFloat64Ptr struct {
|
|
|
|
A *float64 `json:"a"`
|
|
|
|
}
|
2021-01-19 14:41:14 +03:00
|
|
|
type structFloat64PtrOmitEmpty struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
type structFloat64PtrString struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
}
|
2021-05-08 16:41:17 +03:00
|
|
|
type structFloat64PtrStringOmitEmpty struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
}
|
2021-01-16 16:16:26 +03:00
|
|
|
|
|
|
|
tests := []struct {
|
2021-02-15 05:31:26 +03:00
|
|
|
name string
|
|
|
|
data interface{}
|
2021-01-16 16:16:26 +03:00
|
|
|
}{
|
2021-03-19 17:31:29 +03:00
|
|
|
{
|
|
|
|
name: "Float64",
|
|
|
|
data: float64(10),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Float64Ptr",
|
|
|
|
data: float64ptr(10),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Float64Ptr3",
|
|
|
|
data: float64ptr3(10),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Float64PtrNil",
|
|
|
|
data: (*float64)(nil),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Float64Ptr3Nil",
|
|
|
|
data: (***float64)(nil),
|
|
|
|
},
|
|
|
|
|
2021-01-19 14:41:14 +03:00
|
|
|
// HeadFloat64Zero
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64Zero",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A float64 `json:"a"`
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64ZeroOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A float64 `json:"a,omitempty"`
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64ZeroString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A float64 `json:"a,string"`
|
|
|
|
}{},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "HeadFloat64ZeroStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A float64 `json:"a,string,omitempty"`
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// HeadFloat64
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A float64 `json:"a"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64OmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A float64 `json:"a,omitempty"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64String",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A float64 `json:"a,string"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "HeadFloat64StringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A float64 `json:"a,string,omitempty"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// HeadFloat64Ptr
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64Ptr",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A *float64 `json:"a"`
|
|
|
|
}{A: float64ptr(1)},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64PtrOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
}{A: float64ptr(1)},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64PtrString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
}{A: float64ptr(1)},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "HeadFloat64PtrStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
}{A: float64ptr(1)},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// HeadFloat64PtrNil
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64PtrNil",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A *float64 `json:"a"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64PtrNilOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64PtrNilString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "HeadFloat64PtrNilStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat64Zero
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64Zero",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A float64 `json:"a"`
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64ZeroOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A float64 `json:"a,omitempty"`
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64ZeroString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A float64 `json:"a,string"`
|
|
|
|
}{},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat64ZeroStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A float64 `json:"a,string,omitempty"`
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat64
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A float64 `json:"a"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64OmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A float64 `json:"a,omitempty"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64String",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A float64 `json:"a,string"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat64StringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A float64 `json:"a,string,omitempty"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat64Ptr
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64Ptr",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *float64 `json:"a"`
|
|
|
|
}{A: float64ptr(1)},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64PtrOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
}{A: float64ptr(1)},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64PtrString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
}{A: float64ptr(1)},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat64PtrStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
}{A: float64ptr(1)},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat64PtrNil
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64PtrNil",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *float64 `json:"a"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64PtrNilOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64PtrNilString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat64PtrNilStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat64Nil
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64Nil",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *float64 `json:"a"`
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64NilOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64NilString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat64NilStringOmitEmpty",
|
|
|
|
data: (*struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// HeadFloat64ZeroMultiFields
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64ZeroMultiFields",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A float64 `json:"a"`
|
|
|
|
B float64 `json:"b"`
|
2021-02-15 05:31:26 +03:00
|
|
|
C float64 `json:"c"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64ZeroMultiFieldsOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A float64 `json:"a,omitempty"`
|
|
|
|
B float64 `json:"b,omitempty"`
|
2021-02-15 05:31:26 +03:00
|
|
|
C float64 `json:"c,omitempty"`
|
2021-01-19 14:41:14 +03:00
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-05-08 16:41:17 +03:00
|
|
|
name: "HeadFloat64ZeroMultiFieldsString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A float64 `json:"a,string"`
|
|
|
|
B float64 `json:"b,string"`
|
2021-02-15 05:31:26 +03:00
|
|
|
C float64 `json:"c,string"`
|
2021-01-19 14:41:14 +03:00
|
|
|
}{},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "HeadFloat64ZeroMultiFieldsStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A float64 `json:"a,string,omitempty"`
|
|
|
|
B float64 `json:"b,string,omitempty"`
|
|
|
|
C float64 `json:"c,string,omitempty"`
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// HeadFloat64MultiFields
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64MultiFields",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A float64 `json:"a"`
|
|
|
|
B float64 `json:"b"`
|
2021-02-15 05:31:26 +03:00
|
|
|
C float64 `json:"c"`
|
|
|
|
}{A: 1, B: 2, C: 3},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64MultiFieldsOmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float64 `json:"a,omitempty"`
|
|
|
|
B float64 `json:"b,omitempty"`
|
2021-02-15 05:31:26 +03:00
|
|
|
C float64 `json:"c,omitempty"`
|
|
|
|
}{A: 1, B: 2, C: 3},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64MultiFieldsString",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float64 `json:"a,string"`
|
|
|
|
B float64 `json:"b,string"`
|
2021-02-15 05:31:26 +03:00
|
|
|
C float64 `json:"c,string"`
|
|
|
|
}{A: 1, B: 2, C: 3},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "HeadFloat64MultiFieldsStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A float64 `json:"a,string,omitempty"`
|
|
|
|
B float64 `json:"b,string,omitempty"`
|
|
|
|
C float64 `json:"c,string,omitempty"`
|
|
|
|
}{A: 1, B: 2, C: 3},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// HeadFloat64PtrMultiFields
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64PtrMultiFields",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *float64 `json:"a"`
|
|
|
|
B *float64 `json:"b"`
|
2021-02-15 05:31:26 +03:00
|
|
|
C *float64 `json:"c"`
|
|
|
|
}{A: float64ptr(1), B: float64ptr(2), C: float64ptr(3)},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64PtrMultiFieldsOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
B *float64 `json:"b,omitempty"`
|
2021-02-15 05:31:26 +03:00
|
|
|
C *float64 `json:"c,omitempty"`
|
|
|
|
}{A: float64ptr(1), B: float64ptr(2), C: float64ptr(3)},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64PtrMultiFieldsString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
B *float64 `json:"b,string"`
|
2021-02-15 05:31:26 +03:00
|
|
|
C *float64 `json:"c,string"`
|
|
|
|
}{A: float64ptr(1), B: float64ptr(2), C: float64ptr(3)},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "HeadFloat64PtrMultiFieldsStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
B *float64 `json:"b,string,omitempty"`
|
|
|
|
C *float64 `json:"c,string,omitempty"`
|
|
|
|
}{A: float64ptr(1), B: float64ptr(2), C: float64ptr(3)},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// HeadFloat64PtrNilMultiFields
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64PtrNilMultiFields",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A *float64 `json:"a"`
|
|
|
|
B *float64 `json:"b"`
|
2021-02-15 05:31:26 +03:00
|
|
|
C *float64 `json:"c"`
|
|
|
|
}{A: nil, B: nil, C: nil},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64PtrNilMultiFieldsOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
B *float64 `json:"b,omitempty"`
|
2021-02-15 05:31:26 +03:00
|
|
|
C *float64 `json:"c,omitempty"`
|
|
|
|
}{A: nil, B: nil, C: nil},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64PtrNilMultiFieldsString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
B *float64 `json:"b,string"`
|
2021-02-15 05:31:26 +03:00
|
|
|
C *float64 `json:"c,string"`
|
|
|
|
}{A: nil, B: nil, C: nil},
|
2021-01-19 14:41:14 +03:00
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "HeadFloat64PtrNilMultiFieldsStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
B *float64 `json:"b,string,omitempty"`
|
|
|
|
C *float64 `json:"c,string,omitempty"`
|
|
|
|
}{A: nil, B: nil, C: nil},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat64ZeroMultiFields
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64ZeroMultiFields",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A float64 `json:"a"`
|
|
|
|
B float64 `json:"b"`
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64ZeroMultiFieldsOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A float64 `json:"a,omitempty"`
|
|
|
|
B float64 `json:"b,omitempty"`
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64ZeroMultiFieldsString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A float64 `json:"a,string"`
|
|
|
|
B float64 `json:"b,string"`
|
|
|
|
}{},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat64ZeroMultiFieldsStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A float64 `json:"a,string,omitempty"`
|
|
|
|
B float64 `json:"b,string,omitempty"`
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat64MultiFields
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64MultiFields",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A float64 `json:"a"`
|
|
|
|
B float64 `json:"b"`
|
|
|
|
}{A: 1, B: 2},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64MultiFieldsOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A float64 `json:"a,omitempty"`
|
|
|
|
B float64 `json:"b,omitempty"`
|
|
|
|
}{A: 1, B: 2},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64MultiFieldsString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A float64 `json:"a,string"`
|
|
|
|
B float64 `json:"b,string"`
|
|
|
|
}{A: 1, B: 2},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat64MultiFieldsStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A float64 `json:"a,string,omitempty"`
|
|
|
|
B float64 `json:"b,string,omitempty"`
|
|
|
|
}{A: 1, B: 2},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat64PtrMultiFields
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64PtrMultiFields",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *float64 `json:"a"`
|
|
|
|
B *float64 `json:"b"`
|
|
|
|
}{A: float64ptr(1), B: float64ptr(2)},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64PtrMultiFieldsOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
B *float64 `json:"b,omitempty"`
|
|
|
|
}{A: float64ptr(1), B: float64ptr(2)},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64PtrMultiFieldsString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
B *float64 `json:"b,string"`
|
|
|
|
}{A: float64ptr(1), B: float64ptr(2)},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat64PtrMultiFieldsStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
B *float64 `json:"b,string,omitempty"`
|
|
|
|
}{A: float64ptr(1), B: float64ptr(2)},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat64PtrNilMultiFields
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64PtrNilMultiFields",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *float64 `json:"a"`
|
|
|
|
B *float64 `json:"b"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64PtrNilMultiFieldsOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
B *float64 `json:"b,omitempty"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64PtrNilMultiFieldsString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
B *float64 `json:"b,string"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat64PtrNilMultiFieldsStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
B *float64 `json:"b,string,omitempty"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat64NilMultiFields
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64NilMultiFields",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *float64 `json:"a"`
|
|
|
|
B *float64 `json:"b"`
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64NilMultiFieldsOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
B *float64 `json:"b,omitempty"`
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64NilMultiFieldsString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
B *float64 `json:"b,string"`
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat64NilMultiFieldsStringOmitEmpty",
|
|
|
|
data: (*struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
B *float64 `json:"b,string,omitempty"`
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// HeadFloat64ZeroNotRoot
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64ZeroNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A float64 `json:"a"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64ZeroNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A float64 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64ZeroNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A float64 `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "HeadFloat64ZeroNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A float64 `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// HeadFloat64NotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64NotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A float64 `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A float64 `json:"a"`
|
|
|
|
}{A: 1}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64NotRootOmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float64 `json:"a,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{A: struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float64 `json:"a,omitempty"`
|
|
|
|
}{A: 1}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64NotRootString",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float64 `json:"a,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 14:41:14 +03:00
|
|
|
}{A: struct {
|
|
|
|
A float64 `json:"a,string"`
|
|
|
|
}{A: 1}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "HeadFloat64NotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A float64 `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A float64 `json:"a,string,omitempty"`
|
|
|
|
}{A: 1}},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// HeadFloat64PtrNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64PtrNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A struct {
|
|
|
|
A *float64 `json:"a"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 14:41:14 +03:00
|
|
|
}{A: struct {
|
|
|
|
A *float64 `json:"a"`
|
|
|
|
}{float64ptr(1)}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64PtrNotRootOmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 14:41:14 +03:00
|
|
|
}{A: struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
}{float64ptr(1)}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64PtrNotRootString",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A struct {
|
|
|
|
A *float64 `json:"a,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 14:41:14 +03:00
|
|
|
}{A: struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
}{float64ptr(1)}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "HeadFloat64PtrNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
}{float64ptr(1)}},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// HeadFloat64PtrNilNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64PtrNilNotRoot",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *float64 `json:"a"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64PtrNilNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64PtrNilNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "HeadFloat64PtrNilNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat64ZeroNotRoot
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64ZeroNotRoot",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A float64 `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: new(struct {
|
|
|
|
A float64 `json:"a"`
|
|
|
|
})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64ZeroNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A float64 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: new(struct {
|
|
|
|
A float64 `json:"a,omitempty"`
|
|
|
|
})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64ZeroNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A float64 `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{A: new(struct {
|
|
|
|
A float64 `json:"a,string"`
|
|
|
|
})},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat64ZeroNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A float64 `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: new(struct {
|
|
|
|
A float64 `json:"a,string,omitempty"`
|
|
|
|
})},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat64NotRoot
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64NotRoot",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A float64 `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A float64 `json:"a"`
|
|
|
|
}{A: 1})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64NotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A float64 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A float64 `json:"a,omitempty"`
|
|
|
|
}{A: 1})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64NotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A float64 `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A float64 `json:"a,string"`
|
|
|
|
}{A: 1})},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat64NotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A float64 `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A float64 `json:"a,string,omitempty"`
|
|
|
|
}{A: 1})},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat64PtrNotRoot
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64PtrNotRoot",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *float64 `json:"a"`
|
|
|
|
}{A: float64ptr(1)})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64PtrNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
}{A: float64ptr(1)})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64PtrNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
}{A: float64ptr(1)})},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat64PtrNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
}{A: float64ptr(1)})},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat64PtrNilNotRoot
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64PtrNilNotRoot",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *float64 `json:"a"`
|
|
|
|
}{A: nil})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64PtrNilNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
}{A: nil})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64PtrNilNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
}{A: nil})},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat64PtrNilNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
}{A: nil})},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat64NilNotRoot
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64NilNotRoot",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64NilNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64NilNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
} `json:",string"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat64NilNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
} `json:",string,omitempty"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// HeadFloat64ZeroMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64ZeroMultiFieldsNotRoot",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A float64 `json:"a"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B float64 `json:"b"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64ZeroMultiFieldsNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A float64 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B float64 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64ZeroMultiFieldsNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A float64 `json:"a,string"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B float64 `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "HeadFloat64ZeroMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A float64 `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B float64 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// HeadFloat64MultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64MultiFieldsNotRoot",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A float64 `json:"a"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B float64 `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A float64 `json:"a"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B float64 `json:"b"`
|
|
|
|
}{B: 2}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64MultiFieldsNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A float64 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B float64 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A float64 `json:"a,omitempty"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B float64 `json:"b,omitempty"`
|
|
|
|
}{B: 2}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64MultiFieldsNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A float64 `json:"a,string"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B float64 `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A float64 `json:"a,string"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B float64 `json:"b,string"`
|
|
|
|
}{B: 2}},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "HeadFloat64MultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A float64 `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B float64 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A float64 `json:"a,string,omitempty"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B float64 `json:"b,string,omitempty"`
|
|
|
|
}{B: 2}},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// HeadFloat64PtrMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64PtrMultiFieldsNotRoot",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *float64 `json:"a"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *float64 `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *float64 `json:"a"`
|
|
|
|
}{A: float64ptr(1)}, B: struct {
|
|
|
|
B *float64 `json:"b"`
|
|
|
|
}{B: float64ptr(2)}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64PtrMultiFieldsNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *float64 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
}{A: float64ptr(1)}, B: struct {
|
|
|
|
B *float64 `json:"b,omitempty"`
|
|
|
|
}{B: float64ptr(2)}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64PtrMultiFieldsNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *float64 `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
}{A: float64ptr(1)}, B: struct {
|
|
|
|
B *float64 `json:"b,string"`
|
|
|
|
}{B: float64ptr(2)}},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "HeadFloat64PtrMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *float64 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
}{A: float64ptr(1)}, B: struct {
|
|
|
|
B *float64 `json:"b,string,omitempty"`
|
|
|
|
}{B: float64ptr(2)}},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// HeadFloat64PtrNilMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64PtrNilMultiFieldsNotRoot",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *float64 `json:"a"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *float64 `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *float64 `json:"a"`
|
|
|
|
}{A: nil}, B: struct {
|
|
|
|
B *float64 `json:"b"`
|
|
|
|
}{B: nil}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64PtrNilMultiFieldsNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *float64 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
}{A: nil}, B: struct {
|
|
|
|
B *float64 `json:"b,omitempty"`
|
|
|
|
}{B: nil}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "HeadFloat64PtrNilMultiFieldsNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *float64 `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
}{A: nil}, B: struct {
|
|
|
|
B *float64 `json:"b,string"`
|
|
|
|
}{B: nil}},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "HeadFloat64PtrNilMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *float64 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
}{A: nil}, B: struct {
|
|
|
|
B *float64 `json:"b,string,omitempty"`
|
|
|
|
}{B: nil}},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat64ZeroMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64ZeroMultiFieldsNotRoot",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A struct {
|
|
|
|
A float64 `json:"a"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 14:41:14 +03:00
|
|
|
B struct {
|
|
|
|
B float64 `json:"b"`
|
|
|
|
}
|
|
|
|
}{},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64ZeroMultiFieldsNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A struct {
|
|
|
|
A float64 `json:"a,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 14:41:14 +03:00
|
|
|
B struct {
|
|
|
|
B float64 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64ZeroMultiFieldsNotRootString",
|
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 float64 `json:"a,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
B float64 `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat64ZeroMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A struct {
|
|
|
|
A float64 `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B float64 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat64MultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64MultiFieldsNotRoot",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A struct {
|
|
|
|
A float64 `json:"a"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B float64 `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A float64 `json:"a"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B float64 `json:"b"`
|
|
|
|
}{B: 2}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64MultiFieldsNotRootOmitEmpty",
|
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 float64 `json:"a,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
B float64 `json:"b,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{A: struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float64 `json:"a,omitempty"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B float64 `json:"b,omitempty"`
|
|
|
|
}{B: 2}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64MultiFieldsNotRootString",
|
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 float64 `json:"a,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
B float64 `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{A: struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float64 `json:"a,string"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B float64 `json:"b,string"`
|
|
|
|
}{B: 2}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat64MultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A struct {
|
|
|
|
A float64 `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B float64 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A float64 `json:"a,string,omitempty"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B float64 `json:"b,string,omitempty"`
|
|
|
|
}{B: 2}},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat64PtrMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64PtrMultiFieldsNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 14:41:14 +03:00
|
|
|
B *struct {
|
|
|
|
B *float64 `json:"b"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 14:41:14 +03:00
|
|
|
}{A: &(struct {
|
|
|
|
A *float64 `json:"a"`
|
|
|
|
}{A: float64ptr(1)}), B: &(struct {
|
|
|
|
B *float64 `json:"b"`
|
|
|
|
}{B: float64ptr(2)})},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64PtrMultiFieldsNotRootOmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *float64 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
}{A: float64ptr(1)}), B: &(struct {
|
|
|
|
B *float64 `json:"b,omitempty"`
|
|
|
|
}{B: float64ptr(2)})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64PtrMultiFieldsNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *float64 `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
}{A: float64ptr(1)}), B: &(struct {
|
|
|
|
B *float64 `json:"b,string"`
|
|
|
|
}{B: float64ptr(2)})},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat64PtrMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *float64 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
}{A: float64ptr(1)}), B: &(struct {
|
|
|
|
B *float64 `json:"b,string,omitempty"`
|
|
|
|
}{B: float64ptr(2)})},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat64PtrNilMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64PtrNilMultiFieldsNotRoot",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *float64 `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64PtrNilMultiFieldsNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
B *struct {
|
|
|
|
B *float64 `json:"b,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64PtrNilMultiFieldsNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
} `json:",string"`
|
|
|
|
B *struct {
|
|
|
|
B *float64 `json:"b,string"`
|
|
|
|
} `json:",string"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat64PtrNilMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
} `json:",string,omitempty"`
|
|
|
|
B *struct {
|
|
|
|
B *float64 `json:"b,string,omitempty"`
|
|
|
|
} `json:",string,omitempty"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat64NilMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64NilMultiFieldsNotRoot",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *float64 `json:"b"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64NilMultiFieldsNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *float64 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64NilMultiFieldsNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *float64 `json:"b,string"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat64NilMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *float64 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat64DoubleMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64DoubleMultiFieldsNotRoot",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A float64 `json:"a"`
|
2021-01-19 14:41:14 +03:00
|
|
|
B float64 `json:"b"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 14:41:14 +03:00
|
|
|
B *struct {
|
|
|
|
A float64 `json:"a"`
|
2021-01-16 16:16:26 +03:00
|
|
|
B float64 `json:"b"`
|
|
|
|
}
|
2021-01-19 14:41:14 +03:00
|
|
|
}{A: &(struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A float64 `json:"a"`
|
|
|
|
B float64 `json:"b"`
|
2021-01-19 14:41:14 +03:00
|
|
|
}{A: 1, B: 2}), B: &(struct {
|
|
|
|
A float64 `json:"a"`
|
|
|
|
B float64 `json:"b"`
|
|
|
|
}{A: 3, B: 4})},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64DoubleMultiFieldsNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A float64 `json:"a,omitempty"`
|
|
|
|
B float64 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A float64 `json:"a,omitempty"`
|
|
|
|
B float64 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A float64 `json:"a,omitempty"`
|
|
|
|
B float64 `json:"b,omitempty"`
|
|
|
|
}{A: 1, B: 2}), B: &(struct {
|
|
|
|
A float64 `json:"a,omitempty"`
|
|
|
|
B float64 `json:"b,omitempty"`
|
|
|
|
}{A: 3, B: 4})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64DoubleMultiFieldsNotRootString",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float64 `json:"a,string"`
|
|
|
|
B float64 `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B *struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float64 `json:"a,string"`
|
|
|
|
B float64 `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{A: &(struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float64 `json:"a,string"`
|
|
|
|
B float64 `json:"b,string"`
|
|
|
|
}{A: 1, B: 2}), B: &(struct {
|
|
|
|
A float64 `json:"a,string"`
|
|
|
|
B float64 `json:"b,string"`
|
|
|
|
}{A: 3, B: 4})},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat64DoubleMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A float64 `json:"a,string,omitempty"`
|
|
|
|
B float64 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A float64 `json:"a,string,omitempty"`
|
|
|
|
B float64 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A float64 `json:"a,string,omitempty"`
|
|
|
|
B float64 `json:"b,string,omitempty"`
|
|
|
|
}{A: 1, B: 2}), B: &(struct {
|
|
|
|
A float64 `json:"a,string,omitempty"`
|
|
|
|
B float64 `json:"b,string,omitempty"`
|
|
|
|
}{A: 3, B: 4})},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat64NilDoubleMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64NilDoubleMultiFieldsNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float64 `json:"a"`
|
|
|
|
B float64 `json:"b"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B *struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float64 `json:"a"`
|
|
|
|
B float64 `json:"b"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64NilDoubleMultiFieldsNotRootOmitEmpty",
|
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 float64 `json:"a,omitempty"`
|
|
|
|
B float64 `json:"b,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
B *struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float64 `json:"a,omitempty"`
|
|
|
|
B float64 `json:"b,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
}{A: nil, B: nil},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64NilDoubleMultiFieldsNotRootString",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float64 `json:"a,string"`
|
|
|
|
B float64 `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B *struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float64 `json:"a,string"`
|
|
|
|
B float64 `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:41:17 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat64NilDoubleMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A float64 `json:"a,string,omitempty"`
|
|
|
|
B float64 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A float64 `json:"a,string,omitempty"`
|
|
|
|
B float64 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat64NilDoubleMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64NilDoubleMultiFieldsNotRoot",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: (*struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A *struct {
|
|
|
|
A float64 `json:"a"`
|
|
|
|
B float64 `json:"b"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A float64 `json:"a"`
|
|
|
|
B float64 `json:"b"`
|
|
|
|
}
|
2021-01-19 14:41:14 +03:00
|
|
|
})(nil),
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64NilDoubleMultiFieldsNotRootOmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float64 `json:"a,omitempty"`
|
|
|
|
B float64 `json:"b,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B *struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
A float64 `json:"a,omitempty"`
|
|
|
|
B float64 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64NilDoubleMultiFieldsNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A float64 `json:"a,string"`
|
|
|
|
B float64 `json:"b,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A float64 `json:"a,string"`
|
|
|
|
B float64 `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat64NilDoubleMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A float64 `json:"a,string,omitempty"`
|
|
|
|
B float64 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A float64 `json:"a,string,omitempty"`
|
|
|
|
B float64 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat64PtrDoubleMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64PtrDoubleMultiFieldsNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a"`
|
|
|
|
B *float64 `json:"b"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *float64 `json:"a"`
|
|
|
|
B *float64 `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *float64 `json:"a"`
|
|
|
|
B *float64 `json:"b"`
|
|
|
|
}{A: float64ptr(1), B: float64ptr(2)}), B: &(struct {
|
|
|
|
A *float64 `json:"a"`
|
|
|
|
B *float64 `json:"b"`
|
|
|
|
}{A: float64ptr(3), B: float64ptr(4)})},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64PtrDoubleMultiFieldsNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
B *float64 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
B *float64 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
B *float64 `json:"b,omitempty"`
|
|
|
|
}{A: float64ptr(1), B: float64ptr(2)}), B: &(struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
B *float64 `json:"b,omitempty"`
|
|
|
|
}{A: float64ptr(3), B: float64ptr(4)})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64PtrDoubleMultiFieldsNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
B *float64 `json:"b,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
B *float64 `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
B *float64 `json:"b,string"`
|
|
|
|
}{A: float64ptr(1), B: float64ptr(2)}), B: &(struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
B *float64 `json:"b,string"`
|
|
|
|
}{A: float64ptr(3), B: float64ptr(4)})},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat64PtrDoubleMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
B *float64 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
B *float64 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
B *float64 `json:"b,string,omitempty"`
|
|
|
|
}{A: float64ptr(1), B: float64ptr(2)}), B: &(struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
B *float64 `json:"b,string,omitempty"`
|
|
|
|
}{A: float64ptr(3), B: float64ptr(4)})},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat64PtrNilDoubleMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64PtrNilDoubleMultiFieldsNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a"`
|
|
|
|
B *float64 `json:"b"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *float64 `json:"a"`
|
|
|
|
B *float64 `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64PtrNilDoubleMultiFieldsNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
B *float64 `json:"b,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
B *struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
B *float64 `json:"b,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64PtrNilDoubleMultiFieldsNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
B *float64 `json:"b,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
B *float64 `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat64PtrNilDoubleMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
B *float64 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
B *float64 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrHeadFloat64PtrNilDoubleMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64PtrNilDoubleMultiFieldsNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a"`
|
|
|
|
B *float64 `json:"b"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *float64 `json:"a"`
|
|
|
|
B *float64 `json:"b"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64PtrNilDoubleMultiFieldsNotRootOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
B *float64 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *float64 `json:"a,omitempty"`
|
|
|
|
B *float64 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrHeadFloat64PtrNilDoubleMultiFieldsNotRootString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
B *float64 `json:"b,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *float64 `json:"a,string"`
|
|
|
|
B *float64 `json:"b,string"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadFloat64PtrNilDoubleMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
B *float64 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *float64 `json:"a,string,omitempty"`
|
|
|
|
B *float64 `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// AnonymousHeadFloat64
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "AnonymousHeadFloat64",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat64
|
|
|
|
B float64 `json:"b"`
|
|
|
|
}{
|
|
|
|
structFloat64: structFloat64{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "AnonymousHeadFloat64OmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat64OmitEmpty
|
|
|
|
B float64 `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structFloat64OmitEmpty: structFloat64OmitEmpty{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "AnonymousHeadFloat64String",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat64String
|
|
|
|
B float64 `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structFloat64String: structFloat64String{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "AnonymousHeadFloat64StringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
structFloat64StringOmitEmpty
|
|
|
|
B float64 `json:"b,string,omitempty"`
|
|
|
|
}{
|
|
|
|
structFloat64StringOmitEmpty: structFloat64StringOmitEmpty{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrAnonymousHeadFloat64
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrAnonymousHeadFloat64",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat64
|
|
|
|
B float64 `json:"b"`
|
|
|
|
}{
|
|
|
|
structFloat64: &structFloat64{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrAnonymousHeadFloat64OmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat64OmitEmpty
|
|
|
|
B float64 `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structFloat64OmitEmpty: &structFloat64OmitEmpty{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrAnonymousHeadFloat64String",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat64String
|
|
|
|
B float64 `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structFloat64String: &structFloat64String{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "PtrAnonymousHeadFloat64StringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
*structFloat64StringOmitEmpty
|
|
|
|
B float64 `json:"b,string,omitempty"`
|
|
|
|
}{
|
|
|
|
structFloat64StringOmitEmpty: &structFloat64StringOmitEmpty{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// NilPtrAnonymousHeadFloat64
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "NilPtrAnonymousHeadFloat64",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
*structFloat64
|
2021-01-16 16:16:26 +03:00
|
|
|
B float64 `json:"b"`
|
|
|
|
}{
|
2021-01-19 14:41:14 +03:00
|
|
|
structFloat64: nil,
|
2021-01-16 16:16:26 +03:00
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "NilPtrAnonymousHeadFloat64OmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
*structFloat64OmitEmpty
|
|
|
|
B float64 `json:"b,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}{
|
2021-01-19 14:41:14 +03:00
|
|
|
structFloat64OmitEmpty: nil,
|
|
|
|
B: 2,
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "NilPtrAnonymousHeadFloat64String",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 14:41:14 +03:00
|
|
|
*structFloat64String
|
|
|
|
B float64 `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}{
|
2021-01-19 14:41:14 +03:00
|
|
|
structFloat64String: nil,
|
|
|
|
B: 2,
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "NilPtrAnonymousHeadFloat64StringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
*structFloat64StringOmitEmpty
|
|
|
|
B float64 `json:"b,string,omitempty"`
|
|
|
|
}{
|
|
|
|
structFloat64StringOmitEmpty: nil,
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// AnonymousHeadFloat64Ptr
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "AnonymousHeadFloat64Ptr",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat64Ptr
|
|
|
|
B *float64 `json:"b"`
|
|
|
|
}{
|
|
|
|
structFloat64Ptr: structFloat64Ptr{A: float64ptr(1)},
|
|
|
|
B: float64ptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "AnonymousHeadFloat64PtrOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat64PtrOmitEmpty
|
|
|
|
B *float64 `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structFloat64PtrOmitEmpty: structFloat64PtrOmitEmpty{A: float64ptr(1)},
|
|
|
|
B: float64ptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "AnonymousHeadFloat64PtrString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat64PtrString
|
|
|
|
B *float64 `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structFloat64PtrString: structFloat64PtrString{A: float64ptr(1)},
|
|
|
|
B: float64ptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "AnonymousHeadFloat64PtrStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
structFloat64PtrStringOmitEmpty
|
|
|
|
B *float64 `json:"b,string,omitempty"`
|
|
|
|
}{
|
|
|
|
structFloat64PtrStringOmitEmpty: structFloat64PtrStringOmitEmpty{A: float64ptr(1)},
|
|
|
|
B: float64ptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// AnonymousHeadFloat64PtrNil
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "AnonymousHeadFloat64PtrNil",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat64Ptr
|
|
|
|
B *float64 `json:"b"`
|
|
|
|
}{
|
|
|
|
structFloat64Ptr: structFloat64Ptr{A: nil},
|
|
|
|
B: float64ptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "AnonymousHeadFloat64PtrNilOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat64PtrOmitEmpty
|
|
|
|
B *float64 `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structFloat64PtrOmitEmpty: structFloat64PtrOmitEmpty{A: nil},
|
|
|
|
B: float64ptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "AnonymousHeadFloat64PtrNilString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat64PtrString
|
|
|
|
B *float64 `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structFloat64PtrString: structFloat64PtrString{A: nil},
|
|
|
|
B: float64ptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "AnonymousHeadFloat64PtrNilStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
structFloat64PtrStringOmitEmpty
|
|
|
|
B *float64 `json:"b,string,omitempty"`
|
|
|
|
}{
|
|
|
|
structFloat64PtrStringOmitEmpty: structFloat64PtrStringOmitEmpty{A: nil},
|
|
|
|
B: float64ptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrAnonymousHeadFloat64Ptr
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrAnonymousHeadFloat64Ptr",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat64Ptr
|
|
|
|
B *float64 `json:"b"`
|
|
|
|
}{
|
|
|
|
structFloat64Ptr: &structFloat64Ptr{A: float64ptr(1)},
|
|
|
|
B: float64ptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrAnonymousHeadFloat64PtrOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat64PtrOmitEmpty
|
|
|
|
B *float64 `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structFloat64PtrOmitEmpty: &structFloat64PtrOmitEmpty{A: float64ptr(1)},
|
|
|
|
B: float64ptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrAnonymousHeadFloat64PtrString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat64PtrString
|
|
|
|
B *float64 `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structFloat64PtrString: &structFloat64PtrString{A: float64ptr(1)},
|
|
|
|
B: float64ptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "PtrAnonymousHeadFloat64PtrStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
*structFloat64PtrStringOmitEmpty
|
|
|
|
B *float64 `json:"b,string,omitempty"`
|
|
|
|
}{
|
|
|
|
structFloat64PtrStringOmitEmpty: &structFloat64PtrStringOmitEmpty{A: float64ptr(1)},
|
|
|
|
B: float64ptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// NilPtrAnonymousHeadFloat64Ptr
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "NilPtrAnonymousHeadFloat64Ptr",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat64Ptr
|
|
|
|
B *float64 `json:"b"`
|
|
|
|
}{
|
|
|
|
structFloat64Ptr: nil,
|
|
|
|
B: float64ptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "NilPtrAnonymousHeadFloat64PtrOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat64PtrOmitEmpty
|
|
|
|
B *float64 `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structFloat64PtrOmitEmpty: nil,
|
|
|
|
B: float64ptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "NilPtrAnonymousHeadFloat64PtrString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat64PtrString
|
|
|
|
B *float64 `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structFloat64PtrString: nil,
|
|
|
|
B: float64ptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "NilPtrAnonymousHeadFloat64PtrStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
*structFloat64PtrStringOmitEmpty
|
|
|
|
B *float64 `json:"b,string,omitempty"`
|
|
|
|
}{
|
|
|
|
structFloat64PtrStringOmitEmpty: nil,
|
|
|
|
B: float64ptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// AnonymousHeadFloat64Only
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "AnonymousHeadFloat64Only",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat64
|
|
|
|
}{
|
|
|
|
structFloat64: structFloat64{A: 1},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "AnonymousHeadFloat64OnlyOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat64OmitEmpty
|
|
|
|
}{
|
|
|
|
structFloat64OmitEmpty: structFloat64OmitEmpty{A: 1},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "AnonymousHeadFloat64OnlyString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat64String
|
|
|
|
}{
|
|
|
|
structFloat64String: structFloat64String{A: 1},
|
|
|
|
},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "AnonymousHeadFloat64OnlyStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
structFloat64StringOmitEmpty
|
|
|
|
}{
|
|
|
|
structFloat64StringOmitEmpty: structFloat64StringOmitEmpty{A: 1},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrAnonymousHeadFloat64Only
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrAnonymousHeadFloat64Only",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat64
|
|
|
|
}{
|
|
|
|
structFloat64: &structFloat64{A: 1},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrAnonymousHeadFloat64OnlyOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat64OmitEmpty
|
|
|
|
}{
|
|
|
|
structFloat64OmitEmpty: &structFloat64OmitEmpty{A: 1},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrAnonymousHeadFloat64OnlyString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat64String
|
|
|
|
}{
|
|
|
|
structFloat64String: &structFloat64String{A: 1},
|
|
|
|
},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "PtrAnonymousHeadFloat64OnlyStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
*structFloat64StringOmitEmpty
|
|
|
|
}{
|
|
|
|
structFloat64StringOmitEmpty: &structFloat64StringOmitEmpty{A: 1},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// NilPtrAnonymousHeadFloat64Only
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "NilPtrAnonymousHeadFloat64Only",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat64
|
|
|
|
}{
|
|
|
|
structFloat64: nil,
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "NilPtrAnonymousHeadFloat64OnlyOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat64OmitEmpty
|
|
|
|
}{
|
|
|
|
structFloat64OmitEmpty: nil,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "NilPtrAnonymousHeadFloat64OnlyString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat64String
|
|
|
|
}{
|
|
|
|
structFloat64String: nil,
|
|
|
|
},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "NilPtrAnonymousHeadFloat64OnlyStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
*structFloat64StringOmitEmpty
|
|
|
|
}{
|
|
|
|
structFloat64StringOmitEmpty: nil,
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// AnonymousHeadFloat64PtrOnly
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "AnonymousHeadFloat64PtrOnly",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat64Ptr
|
|
|
|
}{
|
|
|
|
structFloat64Ptr: structFloat64Ptr{A: float64ptr(1)},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "AnonymousHeadFloat64PtrOnlyOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat64PtrOmitEmpty
|
|
|
|
}{
|
|
|
|
structFloat64PtrOmitEmpty: structFloat64PtrOmitEmpty{A: float64ptr(1)},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "AnonymousHeadFloat64PtrOnlyString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat64PtrString
|
|
|
|
}{
|
|
|
|
structFloat64PtrString: structFloat64PtrString{A: float64ptr(1)},
|
|
|
|
},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "AnonymousHeadFloat64PtrOnlyStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
structFloat64PtrStringOmitEmpty
|
|
|
|
}{
|
|
|
|
structFloat64PtrStringOmitEmpty: structFloat64PtrStringOmitEmpty{A: float64ptr(1)},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// AnonymousHeadFloat64PtrNilOnly
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "AnonymousHeadFloat64PtrNilOnly",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat64Ptr
|
|
|
|
}{
|
|
|
|
structFloat64Ptr: structFloat64Ptr{A: nil},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "AnonymousHeadFloat64PtrNilOnlyOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat64PtrOmitEmpty
|
|
|
|
}{
|
|
|
|
structFloat64PtrOmitEmpty: structFloat64PtrOmitEmpty{A: nil},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "AnonymousHeadFloat64PtrNilOnlyString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
structFloat64PtrString
|
|
|
|
}{
|
|
|
|
structFloat64PtrString: structFloat64PtrString{A: nil},
|
|
|
|
},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "AnonymousHeadFloat64PtrNilOnlyStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
structFloat64PtrStringOmitEmpty
|
|
|
|
}{
|
|
|
|
structFloat64PtrStringOmitEmpty: structFloat64PtrStringOmitEmpty{A: nil},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// PtrAnonymousHeadFloat64PtrOnly
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrAnonymousHeadFloat64PtrOnly",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat64Ptr
|
|
|
|
}{
|
|
|
|
structFloat64Ptr: &structFloat64Ptr{A: float64ptr(1)},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrAnonymousHeadFloat64PtrOnlyOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat64PtrOmitEmpty
|
|
|
|
}{
|
|
|
|
structFloat64PtrOmitEmpty: &structFloat64PtrOmitEmpty{A: float64ptr(1)},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "PtrAnonymousHeadFloat64PtrOnlyString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat64PtrString
|
|
|
|
}{
|
|
|
|
structFloat64PtrString: &structFloat64PtrString{A: float64ptr(1)},
|
|
|
|
},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "PtrAnonymousHeadFloat64PtrOnlyStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
*structFloat64PtrStringOmitEmpty
|
|
|
|
}{
|
|
|
|
structFloat64PtrStringOmitEmpty: &structFloat64PtrStringOmitEmpty{A: float64ptr(1)},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
|
|
|
|
// NilPtrAnonymousHeadFloat64PtrOnly
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "NilPtrAnonymousHeadFloat64PtrOnly",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat64Ptr
|
|
|
|
}{
|
|
|
|
structFloat64Ptr: nil,
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 14:41:14 +03:00
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "NilPtrAnonymousHeadFloat64PtrOnlyOmitEmpty",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat64PtrOmitEmpty
|
|
|
|
}{
|
|
|
|
structFloat64PtrOmitEmpty: nil,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:31:26 +03:00
|
|
|
name: "NilPtrAnonymousHeadFloat64PtrOnlyString",
|
2021-01-19 14:41:14 +03:00
|
|
|
data: struct {
|
|
|
|
*structFloat64PtrString
|
|
|
|
}{
|
|
|
|
structFloat64PtrString: nil,
|
|
|
|
},
|
|
|
|
},
|
2021-05-08 16:41:17 +03:00
|
|
|
{
|
|
|
|
name: "NilPtrAnonymousHeadFloat64PtrOnlyStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
*structFloat64PtrStringOmitEmpty
|
|
|
|
}{
|
|
|
|
structFloat64PtrStringOmitEmpty: 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-27 20:14:57 +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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|