Skip to content

Commit 50b1e0f

Browse files
committed
Add example of stack overflow by calling method before end of definition
1 parent afa19f5 commit 50b1e0f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

20_struct/03_methods/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ type person struct {
99
}
1010

1111
func (p person) fullName() string {
12+
// fullName() // Uncomment this line and see the stack overflow!
1213
return p.first + p.last
1314
}
1415

0 commit comments

Comments
 (0)