Skip to content

Commit

Permalink
Merge pull request #4 from hirose31/fast-startup
Browse files Browse the repository at this point in the history
Decide default region by LANG
  • Loading branch information
hirose31 authored Oct 27, 2021
2 parents c8ebc09 + 7b9ebff commit 1d8b0ff
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/m/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ func NewS3Model() *S3Model {
s3m := S3Model{}

// client
cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithRegion("us-east-1"))
region := "us-east-1"
if strings.HasPrefix(os.Getenv("LANG"), "ja") {
region = "ap-northeast-1"
}
cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithRegion(region))
if err != nil {
panic(err)
}
Expand Down

0 comments on commit 1d8b0ff

Please sign in to comment.