From 6cff82dc6c0dedd535cd13f797035dc0b5206d43 Mon Sep 17 00:00:00 2001 From: hallizh Date: Fri, 20 Mar 2020 14:47:41 +0000 Subject: [PATCH] Update structs.go fix: exported func NewPerson returns unexported type *store.person, which can be annoying to use --- examples/structs/structs.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/structs/structs.go b/examples/structs/structs.go index 384b57c..1612a77 100644 --- a/examples/structs/structs.go +++ b/examples/structs/structs.go @@ -12,8 +12,8 @@ type person struct { age int } -// NewPerson constructs a new person struct with the given name -func NewPerson(name string) *person { +// newPerson constructs a new person struct with the given name +func newPerson(name string) *person { // You can safely return a pointer to local variable // as a local variable will survive the scope of the function. p := person{name: name}