This commit is contained in:
Masaaki Goshima 2020-12-30 01:32:06 +09:00
parent 2356c0ceab
commit e372b3498c
2 changed files with 0 additions and 26484 deletions

View File

@ -23,8 +23,6 @@ type opType struct {
HeadToStringTagHead func() string HeadToStringTagHead func() string
PtrHeadToHead func() string PtrHeadToHead func() string
FieldToEnd func() string FieldToEnd func() string
FieldToOmitEmptyEnd func() string
FieldToStringTagEnd func() string
FieldToOmitEmptyField func() string FieldToOmitEmptyField func() string
FieldToStringTagField func() string FieldToStringTagField func() string
} }
@ -42,8 +40,6 @@ func createOpType(op, code string) opType {
HeadToStringTagHead: func() string { return op }, HeadToStringTagHead: func() string { return op },
PtrHeadToHead: func() string { return op }, PtrHeadToHead: func() string { return op },
FieldToEnd: func() string { return op }, FieldToEnd: func() string { return op },
FieldToOmitEmptyEnd: func() string { return op },
FieldToStringTagEnd: func() string { return op },
FieldToOmitEmptyField: func() string { return op }, FieldToOmitEmptyField: func() string { return op },
FieldToStringTagField: func() string { return op }, FieldToStringTagField: func() string { return op },
} }
@ -179,26 +175,6 @@ func (t opType) fieldToEnd() opType {
return t return t
} }
func (t opType) fieldToOmitEmptyEnd() opType {
switch t {
{{- range $type := .OpTypes }}
case op{{ $type.Op }}:
return op{{ call $type.FieldToOmitEmptyEnd }}
{{- end }}
}
return t
}
func (t opType) fieldToStringTagEnd() opType {
switch t {
{{- range $type := .OpTypes }}
case op{{ $type.Op }}:
return op{{ call $type.FieldToStringTagEnd }}
{{- end }}
}
return t
}
func (t opType) fieldToOmitEmptyField() opType { func (t opType) fieldToOmitEmptyField() opType {
switch t { switch t {
{{- range $type := .OpTypes }} {{- range $type := .OpTypes }}
@ -385,8 +361,6 @@ func (t opType) fieldToStringTagField() opType {
) )
}, },
FieldToEnd: func() string { return op }, FieldToEnd: func() string { return op },
FieldToOmitEmptyEnd: func() string { return op },
FieldToStringTagEnd: func() string { return op },
FieldToOmitEmptyField: func() string { return op }, FieldToOmitEmptyField: func() string { return op },
FieldToStringTagField: func() string { return op }, FieldToStringTagField: func() string { return op },
}) })
@ -445,28 +419,6 @@ func (t opType) fieldToStringTagField() opType {
typ, typ,
) )
}, },
FieldToOmitEmptyEnd: func() string {
switch typ {
case "Array", "Map", "MapLoad", "Slice", "Struct", "Recursive":
return op
}
return fmt.Sprintf(
"Struct%sEndOmitEmpty%s",
escapedOrNot,
typ,
)
},
FieldToStringTagEnd: func() string {
switch typ {
case "Array", "Map", "MapLoad", "Slice", "Struct", "Recursive":
return op
}
return fmt.Sprintf(
"Struct%sEndStringTag%s",
escapedOrNot,
typ,
)
},
FieldToOmitEmptyField: func() string { FieldToOmitEmptyField: func() string {
return fmt.Sprintf( return fmt.Sprintf(
"Struct%sFieldOmitEmpty%s", "Struct%sFieldOmitEmpty%s",
@ -524,8 +476,6 @@ func (t opType) fieldToStringTagField() opType {
HeadToStringTagHead: func() string { return op }, HeadToStringTagHead: func() string { return op },
PtrHeadToHead: func() string { return op }, PtrHeadToHead: func() string { return op },
FieldToEnd: func() string { return op }, FieldToEnd: func() string { return op },
FieldToOmitEmptyEnd: func() string { return op },
FieldToStringTagEnd: func() string { return op },
FieldToOmitEmptyField: func() string { return op }, FieldToOmitEmptyField: func() string { return op },
FieldToStringTagField: func() string { return op }, FieldToStringTagField: func() string { return op },
}) })
@ -567,12 +517,6 @@ func (t opType) fieldToStringTagField() opType {
FieldToEnd: func() string { FieldToEnd: func() string {
return fmt.Sprintf("%sIndent", typ.FieldToEnd()) return fmt.Sprintf("%sIndent", typ.FieldToEnd())
}, },
FieldToOmitEmptyEnd: func() string {
return fmt.Sprintf("%sIndent", typ.FieldToOmitEmptyEnd())
},
FieldToStringTagEnd: func() string {
return fmt.Sprintf("%sIndent", typ.FieldToStringTagEnd())
},
}) })
} }
var b bytes.Buffer var b bytes.Buffer

File diff suppressed because it is too large Load Diff