From 5a3e6e7e791ddd4b03209dee1bf5bfaac1d438e9 Mon Sep 17 00:00:00 2001 From: Ariel Mashraki <7413593+a8m@users.noreply.github.com> Date: Fri, 12 Mar 2021 17:07:25 +0200 Subject: [PATCH] examples/entcpkg: fix package name shadowing (#1327) --- examples/entcpkg/ent/template/stringer.tmpl | 4 ++-- examples/entcpkg/ent/user.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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.