Skip to content

Instantly share code, notes, and snippets.

@jay-babu
Last active December 5, 2021 05:26
Show Gist options
  • Save jay-babu/36e936c2eab7a7524fe3b842cdef344f to your computer and use it in GitHub Desktop.
Save jay-babu/36e936c2eab7a7524fe3b842cdef344f to your computer and use it in GitHub Desktop.
Golang DI Code Snippets
// Provider
func NewFirebaseApp() *firebase.App {
opt := option.WithCredentialsFile(filename)
app, err := firebase.NewApp(context.Background(), nil, opt)
if err != nil {
log.Fatalf("error initializing app: %v\n", err)
}
return app
}
func NewFirebaseApp() *firebase.App {
opt := option.WithCredentialsFile(filename)
app, err := firebase.NewApp(context.Background(), nil, opt)
if err != nil {
log.Fatalf("error initializing app: %v\n", err)
}
return app
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment