Skip to content

Instantly share code, notes, and snippets.

@ejamesc
Last active August 29, 2015 14:20
Show Gist options
  • Select an option

  • Save ejamesc/da8ede9d7ce0a6597a7c to your computer and use it in GitHub Desktop.

Select an option

Save ejamesc/da8ede9d7ce0a6597a7c to your computer and use it in GitHub Desktop.
type Blog struct {
Logger *log.Logger
}
func NewBlog() (*Blog, error) {
var b *Blog
logger := log.New(os.Stdout, "[goblawg] ", 0)
b.Logger = logger
// this explodes with a panic: runtime error: invalid memory address or nil pointer dereference
return b, nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment