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
When you want to change, for example, DB Host of your applications you can do any of the following:
49
+
When you want to change, a DB Host of your applications you can do it in 3 ways:
50
50
1. create config `myconf.yaml` file in home directory
51
51
```
52
52
db:
@@ -101,6 +101,12 @@ To set a flag via environment variable, make all letters uppercase and replace '
101
101
102
102
You can set a prefix for environment variables. For example `NewConfReader("myconf").WithPrefix("MYAPP")` will search for environment variables like `MYAPP_DB_HOST`
103
103
104
+
Environment variable names could be set in the struct tag `envvar`. For example
105
+
```
106
+
Password string `envvar:"DB_PASS"`
107
+
```
108
+
will use value from environment variable `DB_PASS` to configure `Password` field.
109
+
104
110
### Command Line Arguments :computer:
105
111
106
112
To set a configuration field via command line argument you need to pass and argument prefixes wiht `--` and lowercase field name with path. Like `--db.host=localhost`
0 commit comments