Last active
December 5, 2021 05:26
-
-
Save jay-babu/36e936c2eab7a7524fe3b842cdef344f to your computer and use it in GitHub Desktop.
Golang DI Code Snippets
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
// 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 | |
} |
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
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