Created
October 2, 2021 20:25
-
-
Save mkock/5cf7c2074210ae854cd0ef9cd86633c3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func main() { | |
| p := player{} // Equivalent to p := player{nil} | |
| fmt.Println(p.intelligence()) // panic: runtime error: invalid memory address or nil pointer dereference | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment