Skip to content

Commit 717870b

Browse files
authored
feat(fxconfig): Added app description support (ankorstore#272)
1 parent 38ab143 commit 717870b

File tree

6 files changed

+9
-3
lines changed

6 files changed

+9
-3
lines changed

fxconfig/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/ankorstore/yokai/fxconfig
33
go 1.20
44

55
require (
6-
github.com/ankorstore/yokai/config v1.3.0
6+
github.com/ankorstore/yokai/config v1.4.0
77
github.com/stretchr/testify v1.9.0
88
go.uber.org/fx v1.21.0
99
)

fxconfig/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
github.com/ankorstore/yokai/config v1.3.0 h1:si2h4mESPN5pj14CBMT/VGFgFn0voKEVylr8hQeIgEk=
2-
github.com/ankorstore/yokai/config v1.3.0/go.mod h1:OV2QiL2dyNLCxhcGO+GcSa8Wm20+00H03VBHm9SPVuE=
1+
github.com/ankorstore/yokai/config v1.4.0 h1:O3ZuTGud388Gq55bQwrfs/vdjYSZZvj0VUL6yZp4rcg=
2+
github.com/ankorstore/yokai/config v1.4.0/go.mod h1:OV2QiL2dyNLCxhcGO+GcSa8Wm20+00H03VBHm9SPVuE=
33
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
44
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
55
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=

fxconfig/module_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ func TestModule(t *testing.T) {
2424
).RequireStart().RequireStop()
2525

2626
assert.Equal(t, "default-app", cfg.AppName())
27+
assert.Equal(t, "default-description", cfg.AppDescription())
2728
assert.Equal(t, config.AppEnvDev, cfg.AppEnv())
2829
assert.True(t, cfg.IsDevEnv())
2930
assert.False(t, cfg.IsTestEnv())
@@ -52,6 +53,7 @@ func TestModuleWithTestEnv(t *testing.T) {
5253
).RequireStart().RequireStop()
5354

5455
assert.Equal(t, "test-app", cfg.AppName())
56+
assert.Equal(t, "test-description", cfg.AppDescription())
5557
assert.Equal(t, config.AppEnvTest, cfg.AppEnv())
5658
assert.False(t, cfg.IsDevEnv())
5759
assert.True(t, cfg.IsTestEnv())
@@ -80,6 +82,7 @@ func TestModuleWithCustomEnv(t *testing.T) {
8082
).RequireStart().RequireStop()
8183

8284
assert.Equal(t, "custom-app", cfg.AppName())
85+
assert.Equal(t, "custom-description", cfg.AppDescription())
8386
assert.Equal(t, "custom", cfg.AppEnv())
8487
assert.False(t, cfg.IsDevEnv())
8588
assert.False(t, cfg.IsTestEnv())

fxconfig/testdata/config/config.custom.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
app:
22
name: custom-app
3+
description: custom-description
34
env: custom
45
debug: true
56
config:

fxconfig/testdata/config/config.test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
app:
22
name: test-app
3+
description: test-description
34
env: test
45
debug: true
56
config:

fxconfig/testdata/config/config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
app:
22
name: default-app
3+
description: default-description
34
env: dev
45
version: 0.1.0
56
debug: false

0 commit comments

Comments
 (0)