From f6a82465434dfa82892ed25d825d3a5ab57aaa2f Mon Sep 17 00:00:00 2001 From: Daved Date: Thu, 23 Apr 2015 13:35:24 -0700 Subject: [PATCH] Corrected MarshalJSON and UnmarshalJSON function comments within template per Francesc's guidance. --- template.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/template.go b/template.go index 36bec89..7c14f0c 100644 --- a/template.go +++ b/template.go @@ -42,7 +42,7 @@ func init() { } } -// MarshalJSON is generated. +// MarshalJSON is generated so {{$typename}} satisfies json.Marshaler. func (r {{$typename}}) MarshalJSON() ([]byte, error) { if s, ok := interface{}(r).(fmt.Stringer); ok { return json.Marshal(s.String()) @@ -54,7 +54,7 @@ func (r {{$typename}}) MarshalJSON() ([]byte, error) { return json.Marshal(s) } -// UnmarshalJSON is generated. +// UnmarshalJSON is generated so {{$typename}} satisfies json.Unmarshaler. func (r *{{$typename}}) UnmarshalJSON(data []byte) error { var s string if err := json.Unmarshal(data, &s); err != nil {