godotenv
godotenv copied to clipboard
using .env files only in development environment?
Hi, I'd like that when I'm developing locally godotenv can read my .env file, but when the code will be deployed in the server, this takes the variables from the environment defined variables, is this possible? thank you
I installed the bin via
go install github.com/joho/godotenv/cmd/godotenv
and then run my code via
godotenv go run ./cmd/serve/main.go
which reads .env from current dir, alternatively pass in paths via -f like so
godotenv -f /path/to/.env,/another/.env go run ./cmd/serve/main.go
like explained in readme