mirror of
https://github.com/joho/godotenv.git
synced 2025-05-31 11:42:15 +00:00
Add the ability to autoload the env file when you import.
This commit is contained in:
parent
42920bbe5d
commit
5896be1361
15
autoload/autoload.go
Normal file
15
autoload/autoload.go
Normal file
@ -0,0 +1,15 @@
|
||||
package "autoload"
|
||||
|
||||
/*
|
||||
You can just read the .env file on import just by doing
|
||||
|
||||
import _ "github.com/joho/godotenv/autoload"
|
||||
|
||||
And bob's your mother's brother
|
||||
*/
|
||||
|
||||
import "github.com/joho/godotenv"
|
||||
|
||||
func init() {
|
||||
_ = godotenv.Load()
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user