Skip to content

Commit 78b171b

Browse files
authored
Merge pull request #26 from yoshidan/master
Support os environment for database.yml
2 parents 8f4677a + 0a46d9d commit 78b171b

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

config/config.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package config
22

33
import (
44
"io/ioutil"
5+
"os"
56

67
"github.com/pkg/errors"
78
"gopkg.in/yaml.v2"
@@ -148,8 +149,9 @@ func Load(configPath string) (*Config, error) {
148149
if err != nil {
149150
return nil, errors.WithStack(err)
150151
}
152+
content := []byte(os.ExpandEnv(string(yamlFile)))
151153
config := &Config{DistributedTransaction: true}
152-
if err := yaml.Unmarshal(yamlFile, &config); err != nil {
154+
if err := yaml.Unmarshal(content, &config); err != nil {
153155
return nil, errors.WithStack(err)
154156
}
155157
globalConfig = config

glide.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

glide.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import:
44
- package: github.com/jessevdk/go-flags
55
- package: github.com/sergi/go-diff
66
- package: github.com/blastrain/vitess-sqlparser
7-
version: 1003c43917a3ddbe167e102b99020cefacdd7e0c
7+
version: a139afbb1abad0805ea6a4e2c0fd4e513a3e0939
88
- package: github.com/pkg/errors
99
- package: gopkg.in/yaml.v2
1010
- package: github.com/mattn/go-sqlite3

0 commit comments

Comments
 (0)