Updated generated code in example
This commit is contained in:
parent
78f796a291
commit
9275cb5b7e
@ -41,6 +41,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MarshalJSON is generated so ShirtSize satisfies json.Marshaler.
|
||||||
func (r ShirtSize) MarshalJSON() ([]byte, error) {
|
func (r ShirtSize) MarshalJSON() ([]byte, error) {
|
||||||
if s, ok := interface{}(r).(fmt.Stringer); ok {
|
if s, ok := interface{}(r).(fmt.Stringer); ok {
|
||||||
return json.Marshal(s.String())
|
return json.Marshal(s.String())
|
||||||
@ -52,6 +53,7 @@ func (r ShirtSize) MarshalJSON() ([]byte, error) {
|
|||||||
return json.Marshal(s)
|
return json.Marshal(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// UnmarshalJSON is generated so ShirtSize satisfies json.Unmarshaler.
|
||||||
func (r *ShirtSize) UnmarshalJSON(data []byte) error {
|
func (r *ShirtSize) UnmarshalJSON(data []byte) error {
|
||||||
var s string
|
var s string
|
||||||
if err := json.Unmarshal(data, &s); err != nil {
|
if err := json.Unmarshal(data, &s); err != nil {
|
||||||
|
@ -44,6 +44,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MarshalJSON is generated so WeekDay satisfies json.Marshaler.
|
||||||
func (r WeekDay) MarshalJSON() ([]byte, error) {
|
func (r WeekDay) MarshalJSON() ([]byte, error) {
|
||||||
if s, ok := interface{}(r).(fmt.Stringer); ok {
|
if s, ok := interface{}(r).(fmt.Stringer); ok {
|
||||||
return json.Marshal(s.String())
|
return json.Marshal(s.String())
|
||||||
@ -55,6 +56,7 @@ func (r WeekDay) MarshalJSON() ([]byte, error) {
|
|||||||
return json.Marshal(s)
|
return json.Marshal(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// UnmarshalJSON is generated so WeekDay satisfies json.Unmarshaler.
|
||||||
func (r *WeekDay) UnmarshalJSON(data []byte) error {
|
func (r *WeekDay) UnmarshalJSON(data []byte) error {
|
||||||
var s string
|
var s string
|
||||||
if err := json.Unmarshal(data, &s); err != nil {
|
if err := json.Unmarshal(data, &s); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user