@@ -51,6 +51,7 @@ For the following examples, we will be considering those configuration files:
51
51
# ./configs/config.yaml
52
52
app :
53
53
name : app
54
+ description : app description
54
55
env : dev
55
56
version : 0.1.0
56
57
debug : false
@@ -109,10 +110,11 @@ func main() {
109
110
cfg, _ := config.NewDefaultConfigFactory().Create()
110
111
111
112
// helpers
112
- fmt.Printf("name: %s", cfg.AppName()) // name: app
113
- fmt.Printf("env: %s", cfg.AppEnv()) // env: dev
114
- fmt.Printf("version: %s", cfg.AppVersion()) // version: 0.1.0
115
- fmt.Printf("debug: %v", cfg.AppDebug()) // debug: false
113
+ fmt.Printf("name: %s", cfg.AppName()) // name: app
114
+ fmt.Printf("description: %s", cfg.AppDescription()) // description: app description
115
+ fmt.Printf("env: %s", cfg.AppEnv()) // env: dev
116
+ fmt.Printf("version: %s", cfg.AppVersion()) // version: 0.1.0
117
+ fmt.Printf("debug: %v", cfg.AppDebug()) // debug: false
116
118
117
119
// others
118
120
fmt.Printf("string_value: %s", cfg.GetString("config.values.string_value")) // string_value: default
@@ -146,11 +148,12 @@ func main() {
146
148
cfg, _ := config.NewDefaultConfigFactory().Create()
147
149
148
150
// helpers
149
- fmt.Printf("var: %s", cfg.GetEnvVar("APP_ENV")) // var: test
150
- fmt.Printf("name: %s", cfg.AppName()) // name: app
151
- fmt.Printf("env: %s", cfg.AppEnv()) // env: test
152
- fmt.Printf("version: %s", cfg.AppVersion()) // version: 0.1.0
153
- fmt.Printf("debug: %v", cfg.AppDebug()) // debug: true
151
+ fmt.Printf("var: %s", cfg.GetEnvVar("APP_ENV")) // var: test
152
+ fmt.Printf("name: %s", cfg.AppName()) // name: app
153
+ fmt.Printf("description: %s", cfg.AppDescription()) // description: app description
154
+ fmt.Printf("env: %s", cfg.AppEnv()) // env: test
155
+ fmt.Printf("version: %s", cfg.AppVersion()) // version: 0.1.0
156
+ fmt.Printf("debug: %v", cfg.AppDebug()) // debug: true
154
157
155
158
// others
156
159
fmt.Printf("string_value: %s", cfg.GetString("config.values.string_value")) // string_value: test
0 commit comments