Skip to content

Instantly share code, notes, and snippets.

@ys
Created November 6, 2015 13:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ys/cebebe8c1e260c5f4845 to your computer and use it in GitHub Desktop.
Save ys/cebebe8c1e260c5f4845 to your computer and use it in GitHub Desktop.
diff --git a/physical/s3.go b/physical/s3.go
index 398ada5..fb50248 100644
--- a/physical/s3.go
+++ b/physical/s3.go
@@ -32,7 +31,10 @@ func newS3Backend(conf map[string]string) (Backend, error) {
bucket, ok := conf["bucket"]
if !ok {
- return nil, fmt.Errorf("'bucket' must be set")
+ bucket = os.Getenv("AWS_S3_BUCKET")
+ if bucket == "" {
+ return nil, fmt.Errorf("'bucket' must be set")
+ }
}
access_key, ok := conf["access_key"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment