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 TestCoverUint(t *testing.T) {
|
|
|
|
type structUint struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
type structUintOmitEmpty struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
type structUintString struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
}
|
2021-05-06 20:03:39 +03:00
|
|
|
type structUintStringOmitEmpty struct {
|
|
|
|
A uint `json:"a,string,omitempty"`
|
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
|
2021-01-16 16:16:26 +03:00
|
|
|
type structUintPtr struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
type structUintPtrOmitEmpty struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
type structUintPtrString struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}
|
2021-05-06 20:03:39 +03:00
|
|
|
type structUintPtrStringOmitEmpty struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
}
|
2021-01-16 16:16:26 +03:00
|
|
|
|
|
|
|
tests := []struct {
|
2021-02-15 05:24:35 +03:00
|
|
|
name string
|
|
|
|
data interface{}
|
2021-01-16 16:16:26 +03:00
|
|
|
}{
|
2021-03-19 17:31:29 +03:00
|
|
|
{
|
|
|
|
name: "Uint",
|
|
|
|
data: uint(10),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "UintPtr",
|
|
|
|
data: uptr(10),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "UintPtr3",
|
|
|
|
data: uintptr3(10),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "UintPtrNil",
|
|
|
|
data: (*uint)(nil),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "UintPtr3Nil",
|
|
|
|
data: (***uint)(nil),
|
|
|
|
},
|
|
|
|
|
2021-01-19 08:54:27 +03:00
|
|
|
// HeadUintZero
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintZero",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintZeroOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintZeroString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
}{},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "HeadUintZeroStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A uint `json:"a,string,omitempty"`
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// HeadUint
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUint",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "HeadUintStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A uint `json:"a,string,omitempty"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// HeadUintPtr
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtr",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}{A: uptr(1)},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}{A: uptr(1)},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}{A: uptr(1)},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "HeadUintPtrStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
}{A: uptr(1)},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// HeadUintPtrNil
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrNil",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrNilOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrNilString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "HeadUintPtrNilStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUintZero
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintZero",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintZeroOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintZeroString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
}{},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadUintZeroStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A uint `json:"a,string,omitempty"`
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUint
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUint",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadUintStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A uint `json:"a,string,omitempty"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUintPtr
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtr",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}{A: uptr(1)},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}{A: uptr(1)},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}{A: uptr(1)},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadUintPtrStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
}{A: uptr(1)},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUintPtrNil
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNil",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadUintPtrNilStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUintNil
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNil",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadUintNilStringOmitEmpty",
|
|
|
|
data: (*struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// HeadUintZeroMultiFields
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintZeroMultiFields",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
B uint `json:"b"`
|
2021-02-15 05:24:35 +03:00
|
|
|
C uint `json:"c"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintZeroMultiFieldsOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
B uint `json:"b,omitempty"`
|
2021-02-15 05:24:35 +03:00
|
|
|
C uint `json:"c,omitempty"`
|
2021-01-19 08:54:27 +03:00
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-05-06 20:03:39 +03:00
|
|
|
name: "HeadUintZeroMultiFieldsString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
B uint `json:"b,string"`
|
2021-02-15 05:24:35 +03:00
|
|
|
C uint `json:"c,string"`
|
2021-01-19 08:54:27 +03:00
|
|
|
}{},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "HeadUintZeroMultiFieldsStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A uint `json:"a,string,omitempty"`
|
|
|
|
B uint `json:"b,string,omitempty"`
|
|
|
|
C uint `json:"c,string,omitempty"`
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// HeadUintMultiFields
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintMultiFields",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
B uint `json:"b"`
|
2021-02-15 05:24:35 +03:00
|
|
|
C uint `json:"c"`
|
|
|
|
}{A: 1, B: 2, C: 3},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintMultiFieldsOmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
B uint `json:"b,omitempty"`
|
2021-02-15 05:24:35 +03:00
|
|
|
C uint `json:"c,omitempty"`
|
|
|
|
}{A: 1, B: 2, C: 3},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintMultiFieldsString",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,string"`
|
|
|
|
B uint `json:"b,string"`
|
2021-02-15 05:24:35 +03:00
|
|
|
C uint `json:"c,string"`
|
|
|
|
}{A: 1, B: 2, C: 3},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "HeadUintMultiFieldsStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A uint `json:"a,string,omitempty"`
|
|
|
|
B uint `json:"b,string,omitempty"`
|
|
|
|
C uint `json:"c,string,omitempty"`
|
|
|
|
}{A: 1, B: 2, C: 3},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// HeadUintPtrMultiFields
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrMultiFields",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
B *uint `json:"b"`
|
2021-02-15 05:24:35 +03:00
|
|
|
C *uint `json:"c"`
|
|
|
|
}{A: uptr(1), B: uptr(2), C: uptr(3)},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrMultiFieldsOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
B *uint `json:"b,omitempty"`
|
2021-02-15 05:24:35 +03:00
|
|
|
C *uint `json:"c,omitempty"`
|
|
|
|
}{A: uptr(1), B: uptr(2), C: uptr(3)},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrMultiFieldsString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
B *uint `json:"b,string"`
|
2021-02-15 05:24:35 +03:00
|
|
|
C *uint `json:"c,string"`
|
|
|
|
}{A: uptr(1), B: uptr(2), C: uptr(3)},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "HeadUintPtrMultiFieldsStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
B *uint `json:"b,string,omitempty"`
|
|
|
|
C *uint `json:"c,string,omitempty"`
|
|
|
|
}{A: uptr(1), B: uptr(2), C: uptr(3)},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// HeadUintPtrNilMultiFields
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrNilMultiFields",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A *uint `json:"a"`
|
|
|
|
B *uint `json:"b"`
|
2021-02-15 05:24:35 +03:00
|
|
|
C *uint `json:"c"`
|
|
|
|
}{A: nil, B: nil, C: nil},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrNilMultiFieldsOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
B *uint `json:"b,omitempty"`
|
2021-02-15 05:24:35 +03:00
|
|
|
C *uint `json:"c,omitempty"`
|
|
|
|
}{A: nil, B: nil, C: nil},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrNilMultiFieldsString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
B *uint `json:"b,string"`
|
2021-02-15 05:24:35 +03:00
|
|
|
C *uint `json:"c,string"`
|
|
|
|
}{A: nil, B: nil, C: nil},
|
2021-01-19 08:54:27 +03:00
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "HeadUintPtrNilMultiFieldsStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
B *uint `json:"b,string,omitempty"`
|
|
|
|
C *uint `json:"c,string,omitempty"`
|
|
|
|
}{A: nil, B: nil, C: nil},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUintZeroMultiFields
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintZeroMultiFields",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
B uint `json:"b"`
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintZeroMultiFieldsOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
B uint `json:"b,omitempty"`
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintZeroMultiFieldsString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
B uint `json:"b,string"`
|
|
|
|
}{},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadUintZeroMultiFieldsStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A uint `json:"a,string,omitempty"`
|
|
|
|
B uint `json:"b,string,omitempty"`
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUintMultiFields
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintMultiFields",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
B uint `json:"b"`
|
|
|
|
}{A: 1, B: 2},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintMultiFieldsOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
B uint `json:"b,omitempty"`
|
|
|
|
}{A: 1, B: 2},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintMultiFieldsString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
B uint `json:"b,string"`
|
|
|
|
}{A: 1, B: 2},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadUintMultiFieldsStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A uint `json:"a,string,omitempty"`
|
|
|
|
B uint `json:"b,string,omitempty"`
|
|
|
|
}{A: 1, B: 2},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUintPtrMultiFields
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrMultiFields",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}{A: uptr(1), B: uptr(2)},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrMultiFieldsOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}{A: uptr(1), B: uptr(2)},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrMultiFieldsString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}{A: uptr(1), B: uptr(2)},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadUintPtrMultiFieldsStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
B *uint `json:"b,string,omitempty"`
|
|
|
|
}{A: uptr(1), B: uptr(2)},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUintPtrNilMultiFields
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilMultiFields",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilMultiFieldsOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilMultiFieldsString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadUintPtrNilMultiFieldsStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
B *uint `json:"b,string,omitempty"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUintNilMultiFields
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilMultiFields",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
B *uint `json:"b"`
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilMultiFieldsOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilMultiFieldsString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadUintNilMultiFieldsStringOmitEmpty",
|
|
|
|
data: (*struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
B *uint `json:"b,string,omitempty"`
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// HeadUintZeroNotRoot
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintZeroNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintZeroNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintZeroNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "HeadUintZeroNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// HeadUintNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
}{A: 1}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintNotRootOmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{A: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
}{A: 1}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintNotRootString",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
}{A: struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
}{A: 1}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "HeadUintNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A uint `json:"a,string,omitempty"`
|
|
|
|
}{A: 1}},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// HeadUintPtrNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A struct {
|
|
|
|
A *uint `json:"a"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
}{A: struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}{uptr(1)}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrNotRootOmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
}{A: struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}{uptr(1)}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrNotRootString",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A struct {
|
|
|
|
A *uint `json:"a,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
}{A: struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}{uptr(1)}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "HeadUintPtrNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
}{uptr(1)}},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// HeadUintPtrNilNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrNilNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrNilNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrNilNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "HeadUintPtrNilNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUintZeroNotRoot
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintZeroNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: new(struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintZeroNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: new(struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintZeroNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{A: new(struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
})},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadUintZeroNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A uint `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: new(struct {
|
|
|
|
A uint `json:"a,string,omitempty"`
|
|
|
|
})},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUintNotRoot
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
}{A: 1})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
}{A: 1})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
}{A: 1})},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadUintNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A uint `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A uint `json:"a,string,omitempty"`
|
|
|
|
}{A: 1})},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUintPtrNotRoot
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}{A: uptr(1)})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}{A: uptr(1)})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}{A: uptr(1)})},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadUintPtrNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
}{A: uptr(1)})},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUintPtrNilNotRoot
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}{A: nil})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}{A: nil})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}{A: nil})},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadUintPtrNilNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
}{A: nil})},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUintNilNotRoot
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
} `json:",string"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadUintNilNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
} `json:",string,omitempty"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// HeadUintZeroMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintZeroMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B uint `json:"b"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintZeroMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B uint `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintZeroMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B uint `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "HeadUintZeroMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B uint `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// HeadUintMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B uint `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B uint `json:"b"`
|
|
|
|
}{B: 2}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B uint `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B uint `json:"b,omitempty"`
|
|
|
|
}{B: 2}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B uint `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B uint `json:"b,string"`
|
|
|
|
}{B: 2}},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "HeadUintMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B uint `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A uint `json:"a,string,omitempty"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B uint `json:"b,string,omitempty"`
|
|
|
|
}{B: 2}},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// HeadUintPtrMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}{A: uptr(1)}, B: struct {
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}{B: uptr(2)}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}{A: uptr(1)}, B: struct {
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}{B: uptr(2)}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}{A: uptr(1)}, B: struct {
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}{B: uptr(2)}},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "HeadUintPtrMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *uint `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
}{A: uptr(1)}, B: struct {
|
|
|
|
B *uint `json:"b,string,omitempty"`
|
|
|
|
}{B: uptr(2)}},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// HeadUintPtrNilMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrNilMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}{A: nil}, B: struct {
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}{B: nil}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrNilMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}{A: nil}, B: struct {
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}{B: nil}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrNilMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}{A: nil}, B: struct {
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}{B: nil}},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "HeadUintPtrNilMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *uint `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
}{A: nil}, B: struct {
|
|
|
|
B *uint `json:"b,string,omitempty"`
|
|
|
|
}{B: nil}},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUintZeroMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintZeroMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A struct {
|
|
|
|
A uint `json:"a"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
B struct {
|
|
|
|
B uint `json:"b"`
|
|
|
|
}
|
|
|
|
}{},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintZeroMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
B struct {
|
|
|
|
B uint `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintZeroMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
B uint `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadUintZeroMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A struct {
|
|
|
|
A uint `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B uint `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUintMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B uint `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B uint `json:"b"`
|
|
|
|
}{B: 2}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
B uint `json:"b,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{A: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B uint `json:"b,omitempty"`
|
|
|
|
}{B: 2}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
B uint `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{A: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,string"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B uint `json:"b,string"`
|
|
|
|
}{B: 2}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadUintMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A struct {
|
|
|
|
A uint `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B uint `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A uint `json:"a,string,omitempty"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B uint `json:"b,string,omitempty"`
|
|
|
|
}{B: 2}},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUintPtrMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrMultiFieldsNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
B *struct {
|
|
|
|
B *uint `json:"b"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
}{A: &(struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}{A: uptr(1)}), B: &(struct {
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}{B: uptr(2)})},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrMultiFieldsNotRootOmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}{A: uptr(1)}), B: &(struct {
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}{B: uptr(2)})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}{A: uptr(1)}), B: &(struct {
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}{B: uptr(2)})},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadUintPtrMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *uint `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
}{A: uptr(1)}), B: &(struct {
|
|
|
|
B *uint `json:"b,string,omitempty"`
|
|
|
|
}{B: uptr(2)})},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUintPtrNilMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
B *struct {
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
} `json:",string"`
|
|
|
|
B *struct {
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
} `json:",string"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadUintPtrNilMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
} `json:",string,omitempty"`
|
|
|
|
B *struct {
|
|
|
|
B *uint `json:"b,string,omitempty"`
|
|
|
|
} `json:",string,omitempty"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUintNilMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadUintNilMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *uint `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUintDoubleMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintDoubleMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A uint `json:"a"`
|
2021-01-19 08:54:27 +03:00
|
|
|
B uint `json:"b"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
B *struct {
|
|
|
|
A uint `json:"a"`
|
2021-01-16 16:16:26 +03:00
|
|
|
B uint `json:"b"`
|
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
}{A: &(struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A uint `json:"a"`
|
|
|
|
B uint `json:"b"`
|
2021-01-19 08:54:27 +03:00
|
|
|
}{A: 1, B: 2}), B: &(struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
B uint `json:"b"`
|
|
|
|
}{A: 3, B: 4})},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintDoubleMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
B uint `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
B uint `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
B uint `json:"b,omitempty"`
|
|
|
|
}{A: 1, B: 2}), B: &(struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
B uint `json:"b,omitempty"`
|
|
|
|
}{A: 3, B: 4})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintDoubleMultiFieldsNotRootString",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,string"`
|
|
|
|
B uint `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,string"`
|
|
|
|
B uint `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{A: &(struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,string"`
|
|
|
|
B uint `json:"b,string"`
|
|
|
|
}{A: 1, B: 2}), B: &(struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
B uint `json:"b,string"`
|
|
|
|
}{A: 3, B: 4})},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadUintDoubleMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A uint `json:"a,string,omitempty"`
|
|
|
|
B uint `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A uint `json:"a,string,omitempty"`
|
|
|
|
B uint `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A uint `json:"a,string,omitempty"`
|
|
|
|
B uint `json:"b,string,omitempty"`
|
|
|
|
}{A: 1, B: 2}), B: &(struct {
|
|
|
|
A uint `json:"a,string,omitempty"`
|
|
|
|
B uint `json:"b,string,omitempty"`
|
|
|
|
}{A: 3, B: 4})},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUintNilDoubleMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilDoubleMultiFieldsNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a"`
|
|
|
|
B uint `json:"b"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a"`
|
|
|
|
B uint `json:"b"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilDoubleMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
B uint `json:"b,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
B *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
B uint `json:"b,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
}{A: nil, B: nil},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilDoubleMultiFieldsNotRootString",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,string"`
|
|
|
|
B uint `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,string"`
|
|
|
|
B uint `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
}{A: nil, B: nil},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadUintNilDoubleMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A uint `json:"a,string,omitempty"`
|
|
|
|
B uint `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A uint `json:"a,string,omitempty"`
|
|
|
|
B uint `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUintNilDoubleMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilDoubleMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A *struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
B uint `json:"b"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
B uint `json:"b"`
|
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
})(nil),
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilDoubleMultiFieldsNotRootOmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
B uint `json:"b,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
B uint `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilDoubleMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
B uint `json:"b,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
B uint `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadUintNilDoubleMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A uint `json:"a,string,omitempty"`
|
|
|
|
B uint `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A uint `json:"a,string,omitempty"`
|
|
|
|
B uint `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUintPtrDoubleMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrDoubleMultiFieldsNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}{A: uptr(1), B: uptr(2)}), B: &(struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}{A: uptr(3), B: uptr(4)})},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrDoubleMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}{A: uptr(1), B: uptr(2)}), B: &(struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}{A: uptr(3), B: uptr(4)})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrDoubleMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}{A: uptr(1), B: uptr(2)}), B: &(struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}{A: uptr(3), B: uptr(4)})},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadUintPtrDoubleMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
B *uint `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
B *uint `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
B *uint `json:"b,string,omitempty"`
|
|
|
|
}{A: uptr(1), B: uptr(2)}), B: &(struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
B *uint `json:"b,string,omitempty"`
|
|
|
|
}{A: uptr(3), B: uptr(4)})},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUintPtrNilDoubleMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilDoubleMultiFieldsNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilDoubleMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
B *struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilDoubleMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadUintPtrNilDoubleMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
B *uint `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
B *uint `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUintPtrNilDoubleMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilDoubleMultiFieldsNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilDoubleMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilDoubleMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "PtrHeadUintPtrNilDoubleMultiFieldsNotRootStringOmitEmpty",
|
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
B *uint `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint `json:"a,string,omitempty"`
|
|
|
|
B *uint `json:"b,string,omitempty"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// AnonymousHeadUint
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUint",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUint
|
|
|
|
B uint `json:"b"`
|
|
|
|
}{
|
|
|
|
structUint: structUint{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUintOmitEmpty
|
|
|
|
B uint `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structUintOmitEmpty: structUintOmitEmpty{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUintString
|
|
|
|
B uint `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structUintString: structUintString{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "AnonymousHeadUintStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
structUintStringOmitEmpty
|
|
|
|
B uint `json:"b,string,omitempty"`
|
|
|
|
}{
|
|
|
|
structUintStringOmitEmpty: structUintStringOmitEmpty{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrAnonymousHeadUint
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrAnonymousHeadUint",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint
|
|
|
|
B uint `json:"b"`
|
|
|
|
}{
|
|
|
|
structUint: &structUint{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrAnonymousHeadUintOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintOmitEmpty
|
|
|
|
B uint `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structUintOmitEmpty: &structUintOmitEmpty{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrAnonymousHeadUintString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintString
|
|
|
|
B uint `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structUintString: &structUintString{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "PtrAnonymousHeadUintStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
*structUintStringOmitEmpty
|
|
|
|
B uint `json:"b,string,omitempty"`
|
|
|
|
}{
|
|
|
|
structUintStringOmitEmpty: &structUintStringOmitEmpty{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// NilPtrAnonymousHeadUint
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "NilPtrAnonymousHeadUint",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
*structUint
|
2021-01-16 16:16:26 +03:00
|
|
|
B uint `json:"b"`
|
|
|
|
}{
|
2021-01-19 08:54:27 +03:00
|
|
|
structUint: nil,
|
2021-01-16 16:16:26 +03:00
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "NilPtrAnonymousHeadUintOmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
*structUintOmitEmpty
|
|
|
|
B uint `json:"b,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}{
|
2021-01-19 08:54:27 +03:00
|
|
|
structUintOmitEmpty: nil,
|
|
|
|
B: 2,
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "NilPtrAnonymousHeadUintString",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
*structUintString
|
|
|
|
B uint `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}{
|
2021-01-19 08:54:27 +03:00
|
|
|
structUintString: nil,
|
|
|
|
B: 2,
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "NilPtrAnonymousHeadUintStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
*structUintStringOmitEmpty
|
|
|
|
B uint `json:"b,string,omitempty"`
|
|
|
|
}{
|
|
|
|
structUintStringOmitEmpty: nil,
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// AnonymousHeadUintPtr
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintPtr",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
structUintPtr
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}{
|
|
|
|
structUintPtr: structUintPtr{A: uptr(1)},
|
|
|
|
B: uptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintPtrOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUintPtrOmitEmpty
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structUintPtrOmitEmpty: structUintPtrOmitEmpty{A: uptr(1)},
|
|
|
|
B: uptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintPtrString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUintPtrString
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structUintPtrString: structUintPtrString{A: uptr(1)},
|
|
|
|
B: uptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "AnonymousHeadUintPtrStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
structUintPtrStringOmitEmpty
|
|
|
|
B *uint `json:"b,string,omitempty"`
|
|
|
|
}{
|
|
|
|
structUintPtrStringOmitEmpty: structUintPtrStringOmitEmpty{A: uptr(1)},
|
|
|
|
B: uptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// AnonymousHeadUintPtrNil
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintPtrNil",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
structUintPtr
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}{
|
|
|
|
structUintPtr: structUintPtr{A: nil},
|
|
|
|
B: uptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintPtrNilOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUintPtrOmitEmpty
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structUintPtrOmitEmpty: structUintPtrOmitEmpty{A: nil},
|
|
|
|
B: uptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintPtrNilString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUintPtrString
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structUintPtrString: structUintPtrString{A: nil},
|
|
|
|
B: uptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "AnonymousHeadUintPtrNilStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
structUintPtrStringOmitEmpty
|
|
|
|
B *uint `json:"b,string,omitempty"`
|
|
|
|
}{
|
|
|
|
structUintPtrStringOmitEmpty: structUintPtrStringOmitEmpty{A: nil},
|
|
|
|
B: uptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrAnonymousHeadUintPtr
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrAnonymousHeadUintPtr",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintPtr
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}{
|
|
|
|
structUintPtr: &structUintPtr{A: uptr(1)},
|
|
|
|
B: uptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrAnonymousHeadUintPtrOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintPtrOmitEmpty
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structUintPtrOmitEmpty: &structUintPtrOmitEmpty{A: uptr(1)},
|
|
|
|
B: uptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrAnonymousHeadUintPtrString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintPtrString
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structUintPtrString: &structUintPtrString{A: uptr(1)},
|
|
|
|
B: uptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "PtrAnonymousHeadUintPtrStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
*structUintPtrStringOmitEmpty
|
|
|
|
B *uint `json:"b,string,omitempty"`
|
|
|
|
}{
|
|
|
|
structUintPtrStringOmitEmpty: &structUintPtrStringOmitEmpty{A: uptr(1)},
|
|
|
|
B: uptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// NilPtrAnonymousHeadUintPtr
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "NilPtrAnonymousHeadUintPtr",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintPtr
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}{
|
|
|
|
structUintPtr: nil,
|
|
|
|
B: uptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "NilPtrAnonymousHeadUintPtrOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintPtrOmitEmpty
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structUintPtrOmitEmpty: nil,
|
|
|
|
B: uptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "NilPtrAnonymousHeadUintPtrString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintPtrString
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structUintPtrString: nil,
|
|
|
|
B: uptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "NilPtrAnonymousHeadUintPtrStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
*structUintPtrStringOmitEmpty
|
|
|
|
B *uint `json:"b,string,omitempty"`
|
|
|
|
}{
|
|
|
|
structUintPtrStringOmitEmpty: nil,
|
|
|
|
B: uptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// AnonymousHeadUintOnly
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintOnly",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
structUint
|
|
|
|
}{
|
|
|
|
structUint: structUint{A: 1},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintOnlyOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUintOmitEmpty
|
|
|
|
}{
|
|
|
|
structUintOmitEmpty: structUintOmitEmpty{A: 1},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintOnlyString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUintString
|
|
|
|
}{
|
|
|
|
structUintString: structUintString{A: 1},
|
|
|
|
},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "AnonymousHeadUintOnlyStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
structUintStringOmitEmpty
|
|
|
|
}{
|
|
|
|
structUintStringOmitEmpty: structUintStringOmitEmpty{A: 1},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrAnonymousHeadUintOnly
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrAnonymousHeadUintOnly",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint
|
|
|
|
}{
|
|
|
|
structUint: &structUint{A: 1},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrAnonymousHeadUintOnlyOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintOmitEmpty
|
|
|
|
}{
|
|
|
|
structUintOmitEmpty: &structUintOmitEmpty{A: 1},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrAnonymousHeadUintOnlyString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintString
|
|
|
|
}{
|
|
|
|
structUintString: &structUintString{A: 1},
|
|
|
|
},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "PtrAnonymousHeadUintOnlyStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
*structUintStringOmitEmpty
|
|
|
|
}{
|
|
|
|
structUintStringOmitEmpty: &structUintStringOmitEmpty{A: 1},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// NilPtrAnonymousHeadUintOnly
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "NilPtrAnonymousHeadUintOnly",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint
|
|
|
|
}{
|
|
|
|
structUint: nil,
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "NilPtrAnonymousHeadUintOnlyOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintOmitEmpty
|
|
|
|
}{
|
|
|
|
structUintOmitEmpty: nil,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "NilPtrAnonymousHeadUintOnlyString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintString
|
|
|
|
}{
|
|
|
|
structUintString: nil,
|
|
|
|
},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "NilPtrAnonymousHeadUintOnlyStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
*structUintStringOmitEmpty
|
|
|
|
}{
|
|
|
|
structUintStringOmitEmpty: nil,
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// AnonymousHeadUintPtrOnly
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintPtrOnly",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
structUintPtr
|
|
|
|
}{
|
|
|
|
structUintPtr: structUintPtr{A: uptr(1)},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintPtrOnlyOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUintPtrOmitEmpty
|
|
|
|
}{
|
|
|
|
structUintPtrOmitEmpty: structUintPtrOmitEmpty{A: uptr(1)},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintPtrOnlyString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUintPtrString
|
|
|
|
}{
|
|
|
|
structUintPtrString: structUintPtrString{A: uptr(1)},
|
|
|
|
},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "AnonymousHeadUintPtrOnlyStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
structUintPtrStringOmitEmpty
|
|
|
|
}{
|
|
|
|
structUintPtrStringOmitEmpty: structUintPtrStringOmitEmpty{A: uptr(1)},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// AnonymousHeadUintPtrNilOnly
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintPtrNilOnly",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
structUintPtr
|
|
|
|
}{
|
|
|
|
structUintPtr: structUintPtr{A: nil},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintPtrNilOnlyOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUintPtrOmitEmpty
|
|
|
|
}{
|
|
|
|
structUintPtrOmitEmpty: structUintPtrOmitEmpty{A: nil},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintPtrNilOnlyString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUintPtrString
|
|
|
|
}{
|
|
|
|
structUintPtrString: structUintPtrString{A: nil},
|
|
|
|
},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "AnonymousHeadUintPtrNilOnlyStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
structUintPtrStringOmitEmpty
|
|
|
|
}{
|
|
|
|
structUintPtrStringOmitEmpty: structUintPtrStringOmitEmpty{A: nil},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrAnonymousHeadUintPtrOnly
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrAnonymousHeadUintPtrOnly",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintPtr
|
|
|
|
}{
|
|
|
|
structUintPtr: &structUintPtr{A: uptr(1)},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrAnonymousHeadUintPtrOnlyOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintPtrOmitEmpty
|
|
|
|
}{
|
|
|
|
structUintPtrOmitEmpty: &structUintPtrOmitEmpty{A: uptr(1)},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrAnonymousHeadUintPtrOnlyString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintPtrString
|
|
|
|
}{
|
|
|
|
structUintPtrString: &structUintPtrString{A: uptr(1)},
|
|
|
|
},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "PtrAnonymousHeadUintPtrOnlyStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
*structUintPtrStringOmitEmpty
|
|
|
|
}{
|
|
|
|
structUintPtrStringOmitEmpty: &structUintPtrStringOmitEmpty{A: uptr(1)},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// NilPtrAnonymousHeadUintPtrOnly
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "NilPtrAnonymousHeadUintPtrOnly",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintPtr
|
|
|
|
}{
|
|
|
|
structUintPtr: nil,
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "NilPtrAnonymousHeadUintPtrOnlyOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintPtrOmitEmpty
|
|
|
|
}{
|
|
|
|
structUintPtrOmitEmpty: nil,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "NilPtrAnonymousHeadUintPtrOnlyString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintPtrString
|
|
|
|
}{
|
|
|
|
structUintPtrString: nil,
|
|
|
|
},
|
|
|
|
},
|
2021-05-06 20:03:39 +03:00
|
|
|
{
|
|
|
|
name: "NilPtrAnonymousHeadUintPtrOnlyStringOmitEmpty",
|
|
|
|
data: struct {
|
|
|
|
*structUintPtrStringOmitEmpty
|
|
|
|
}{
|
|
|
|
structUintPtrStringOmitEmpty: 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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|