Last active
December 27, 2019 14:43
-
-
Save J7mbo/8d7b5d5255f50da3655f6c3f64a7f162 to your computer and use it in GitHub Desktop.
This file contains 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
type Service struct { | |
Repository *UserRepository | |
} | |
func (s Service) CountNumUsers() int { | |
return s.Repository.Count() | |
} | |
s := Service{} | |
s.CountNumUsers() // SIGSEGV nil pointer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment