You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If `CONFIGOR_ENV` not set, when running tests with `go test`, the ENV will be `test`, otherwise, it will be `development`
64
+
Use `CONFIGOR_ENV` to set environment, if `CONFIGOR_ENV` not set, environment will be `development` by default, and it will be `test` when running tests with `go test`
67
65
68
66
```go
69
67
// config.go
70
68
configor.Load(&Config, "config.json")
71
69
72
70
$ go run config.go
73
-
// Will load `config.json`, `config.development.json` if it is exist
74
-
//And `config.development.json` will overwrite `config.json`'s configuration
71
+
// Will load `config.json`, `config.development.json` if it exists
72
+
// `config.development.json` will overwrite `config.json`'s configuration
75
73
// You could use this to share same configuration across different environments
76
74
77
75
$ CONFIGOR_ENV=production go run config.go
78
-
// Will load `config.json`, `config.production.json` if it is exist
79
-
//And `config.production.json` will overwrite `config.json`'s configuration
76
+
// Will load `config.json`, `config.production.json` if it exists
77
+
// `config.production.json` will overwrite `config.json`'s configuration
80
78
81
79
$ go test
82
-
// Will load `config.json`, `config.test.json` if it is exist
83
-
//And `config.test.json` will overwrite `config.json`'s configuration
80
+
// Will load `config.json`, `config.test.json` if it exists
81
+
// `config.test.json` will overwrite `config.json`'s configuration
84
82
85
83
$ CONFIGOR_ENV=production go test
86
-
// Will load `config.json`, `config.production.json` if it is exist
87
-
// And `config.production.json` will overwrite `config.json`'s configuration
84
+
// Will load `config.json`, `config.production.json` if it exists
85
+
// `config.production.json` will overwrite `config.json`'s configuration
0 commit comments