Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/structs/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func main() {
fmt.Println(sp.age)

// Structs are mutable.
sp.age = 51

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would maybe move the mutable part before the pointer part.

  1. Show structs are mutable with s
  2. Then in the "pointers" section, show both access and mutation one after another, through sp

s.age = 51
fmt.Println(sp.age)

// If a struct type is only used for a single value, we don't
Expand Down
4 changes: 2 additions & 2 deletions examples/structs/structs.hash
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
b50c1756bf9a2ea7f8853f7f7cb7a61d5efebfc3
56SPo-L2nMN
ac73a07b486b9874007dec670f1023ae19396c59
-BmySOlaqkm
6 changes: 3 additions & 3 deletions public/structs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.