diff --git a/examples/entcpkg/ent/template/stringer.tmpl b/examples/entcpkg/ent/template/stringer.tmpl index a25a353a1..072b6d52b 100644 --- a/examples/entcpkg/ent/template/stringer.tmpl +++ b/examples/entcpkg/ent/template/stringer.tmpl @@ -4,10 +4,10 @@ // GoString implements the fmt.GoStringer interface. func ({{ $.Receiver }} *{{ $.Name }}) GoString() string { - json, err := json.MarshalIndent({{ $.Receiver }}, "", "\t") + b, err := json.MarshalIndent({{ $.Receiver }}, "", "\t") if err != nil { return err.Error() } - return string(json) + return string(b) } {{ end }} diff --git a/examples/entcpkg/ent/user.go b/examples/entcpkg/ent/user.go index d55cfe5bd..41a9a046a 100644 --- a/examples/entcpkg/ent/user.go +++ b/examples/entcpkg/ent/user.go @@ -87,11 +87,11 @@ func (u *User) String() string { // GoString implements the fmt.GoStringer interface. func (u *User) GoString() string { - json, err := json.MarshalIndent(u, "", "\t") + b, err := json.MarshalIndent(u, "", "\t") if err != nil { return err.Error() } - return string(json) + return string(b) } // Users is a parsable slice of User.