Skip to content

Commit

Permalink
feat: update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
1995parham committed Apr 16, 2024
1 parent 97a74a7 commit cab4b3c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 4 additions & 1 deletion 12-pointers/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions 13-structs-with-pointer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ func main() {
Age: 27,
}

var _ fmt.Stringer = p
var _ fmt.Stringer = &p

fmt.Println(p)

p.BeOlder(1)
Expand Down

0 comments on commit cab4b3c

Please sign in to comment.