Added MarshalJSON and UnmarshalJSON comments to template to prevent

golint from complaining.
This commit is contained in:
Daved 2015-04-23 09:30:11 -07:00
parent a9a20fa77c
commit 3699e12530
1 changed files with 2 additions and 0 deletions

View File

@ -42,6 +42,7 @@ func init() {
}
}
// MarshalJSON is generated.
func (r {{$typename}}) MarshalJSON() ([]byte, error) {
if s, ok := interface{}(r).(fmt.Stringer); ok {
return json.Marshal(s.String())
@ -53,6 +54,7 @@ func (r {{$typename}}) MarshalJSON() ([]byte, error) {
return json.Marshal(s)
}
// UnmarshalJSON is generated.
func (r *{{$typename}}) UnmarshalJSON(data []byte) error {
var s string
if err := json.Unmarshal(data, &s); err != nil {