Update readme

This commit is contained in:
John Barton (joho) 2013-07-31 14:38:18 +10:00
parent 9ec71cc6c8
commit 85e631994e

View File

@ -31,13 +31,17 @@ import (
"os" "os"
) )
err := godotenv.Load() func main() {
if err != nil { err := godotenv.Load()
if err != nil {
os.Fatal("Error loading .env file") os.Fatal("Error loading .env file")
} }
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