forked from coop-cloud-mirrors/godotenv
Update readme
This commit is contained in:
parent
9ec71cc6c8
commit
85e631994e
@ -31,6 +31,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
err := godotenv.Load()
|
err := godotenv.Load()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
os.Fatal("Error loading .env file")
|
os.Fatal("Error loading .env file")
|
||||||
@ -38,6 +39,9 @@ if err != nil {
|
|||||||
|
|
||||||
s3Bucket := os.Getenv("S3_BUCKET")
|
s3Bucket := os.Getenv("S3_BUCKET")
|
||||||
secretKey := os.Getenv("SECRET_KEY")
|
secretKey := os.Getenv("SECRET_KEY")
|
||||||
|
|
||||||
|
// now do something with s3 or whatever
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
While `.env` in the project root is the default, you don't have to be constrained
|
While `.env` in the project root is the default, you don't have to be constrained
|
||||||
|
Loading…
x
Reference in New Issue
Block a user