Reputation:
I am working on a Go project. I want to create an .env file. I refer to the docs but I am not understanding how to do it & where to put that file & how can I use it? Can you guys please help me? Link: https://firebase.google.com/docs/firestore/quickstart#go
Upvotes: 0
Views: 656
Reputation: 36
If you want to load a .env
file in Golang, you can use the github.com/joho/godotenv
module. Then, you can load your file with godotenv.Load()
.
I usually prefer to use direnv
and have .envrc
for each of my project so I can just the os
lib and load the environment variables :)
Upvotes: 1