From cab4b3c3069109273ece2efcb023aca0b3a76039 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 16 Apr 2024 13:59:51 +0000 Subject: [PATCH] feat: update examples --- 12-pointers/main.go | 5 ++++- 13-structs-with-pointer/main.go | 3 --- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/12-pointers/main.go b/12-pointers/main.go index 72be649..75482c9 100644 --- a/12-pointers/main.go +++ b/12-pointers/main.go @@ -27,7 +27,10 @@ func main() { fmt.Printf("%d\n", a) b := new(int) - *b = 10 + *b = 12 + fmt.Printf("b = %p, *b = %d\n", b, *b) + + b = &a fmt.Printf("b = %p, *b = %d\n", b, *b) var c *int diff --git a/13-structs-with-pointer/main.go b/13-structs-with-pointer/main.go index 075d179..84a3205 100644 --- a/13-structs-with-pointer/main.go +++ b/13-structs-with-pointer/main.go @@ -34,9 +34,6 @@ func main() { Age: 27, } - var _ fmt.Stringer = p - var _ fmt.Stringer = &p - fmt.Println(p) p.BeOlder(1)