From 9275cb5b7e9258b0895b1213a688b9de6301b10c Mon Sep 17 00:00:00 2001 From: damnever Date: Sat, 13 May 2017 18:35:02 +0800 Subject: [PATCH] Updated generated code in example --- example/shirtsize_jsonenums.go | 2 ++ example/weekday_jsonenums.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/example/shirtsize_jsonenums.go b/example/shirtsize_jsonenums.go index af60b7e..d50c71a 100644 --- a/example/shirtsize_jsonenums.go +++ b/example/shirtsize_jsonenums.go @@ -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 { diff --git a/example/weekday_jsonenums.go b/example/weekday_jsonenums.go index c24d250..a97dd11 100644 --- a/example/weekday_jsonenums.go +++ b/example/weekday_jsonenums.go @@ -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 {