examples/entcpkg: fix package name shadowing (#1327)

This commit is contained in:
Ariel Mashraki
2021-03-12 17:07:25 +02:00
committed by GitHub
parent c33512bb94
commit 5a3e6e7e79
2 changed files with 4 additions and 4 deletions

View File

@@ -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 }}

View File

@@ -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.