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) {
|
||||
if s, ok := interface{}(r).(fmt.Stringer); ok {
|
||||
return json.Marshal(s.String())
|
||||
@ -52,6 +53,7 @@ func (r ShirtSize) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(s)
|
||||
}
|
||||
|
||||
// UnmarshalJSON is generated so ShirtSize satisfies json.Unmarshaler.
|
||||
func (r *ShirtSize) UnmarshalJSON(data []byte) error {
|
||||
var s string
|
||||
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) {
|
||||
if s, ok := interface{}(r).(fmt.Stringer); ok {
|
||||
return json.Marshal(s.String())
|
||||
@ -55,6 +56,7 @@ func (r WeekDay) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(s)
|
||||
}
|
||||
|
||||
// UnmarshalJSON is generated so WeekDay satisfies json.Unmarshaler.
|
||||
func (r *WeekDay) UnmarshalJSON(data []byte) error {
|
||||
var s string
|
||||
if err := json.Unmarshal(data, &s); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user