Skip to content

Instantly share code, notes, and snippets.

@J7mbo
Last active December 27, 2019 14:43
Show Gist options
  • Save J7mbo/8d7b5d5255f50da3655f6c3f64a7f162 to your computer and use it in GitHub Desktop.
Save J7mbo/8d7b5d5255f50da3655f6c3f64a7f162 to your computer and use it in GitHub Desktop.
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