From a9f3ce996daad116bc06f6417648ac06219c0d86 Mon Sep 17 00:00:00 2001 From: Jonathan Vuillemin Date: Fri, 26 Jul 2024 10:10:01 +0200 Subject: [PATCH] feat(fxconfig): Added app description support --- fxconfig/go.mod | 2 +- fxconfig/go.sum | 4 ++-- fxconfig/module_test.go | 3 +++ fxconfig/testdata/config/config.custom.yaml | 1 + fxconfig/testdata/config/config.test.yaml | 1 + fxconfig/testdata/config/config.yaml | 1 + 6 files changed, 9 insertions(+), 3 deletions(-) diff --git a/fxconfig/go.mod b/fxconfig/go.mod index 2af9ee11..8c1123a4 100644 --- a/fxconfig/go.mod +++ b/fxconfig/go.mod @@ -3,7 +3,7 @@ module github.com/ankorstore/yokai/fxconfig go 1.20 require ( - github.com/ankorstore/yokai/config v1.3.0 + github.com/ankorstore/yokai/config v1.4.0 github.com/stretchr/testify v1.9.0 go.uber.org/fx v1.21.0 ) diff --git a/fxconfig/go.sum b/fxconfig/go.sum index 9c5465a1..2ee4b761 100644 --- a/fxconfig/go.sum +++ b/fxconfig/go.sum @@ -1,5 +1,5 @@ -github.com/ankorstore/yokai/config v1.3.0 h1:si2h4mESPN5pj14CBMT/VGFgFn0voKEVylr8hQeIgEk= -github.com/ankorstore/yokai/config v1.3.0/go.mod h1:OV2QiL2dyNLCxhcGO+GcSa8Wm20+00H03VBHm9SPVuE= +github.com/ankorstore/yokai/config v1.4.0 h1:O3ZuTGud388Gq55bQwrfs/vdjYSZZvj0VUL6yZp4rcg= +github.com/ankorstore/yokai/config v1.4.0/go.mod h1:OV2QiL2dyNLCxhcGO+GcSa8Wm20+00H03VBHm9SPVuE= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= diff --git a/fxconfig/module_test.go b/fxconfig/module_test.go index 9cf2ed10..264cf005 100644 --- a/fxconfig/module_test.go +++ b/fxconfig/module_test.go @@ -24,6 +24,7 @@ func TestModule(t *testing.T) { ).RequireStart().RequireStop() assert.Equal(t, "default-app", cfg.AppName()) + assert.Equal(t, "default-description", cfg.AppDescription()) assert.Equal(t, config.AppEnvDev, cfg.AppEnv()) assert.True(t, cfg.IsDevEnv()) assert.False(t, cfg.IsTestEnv()) @@ -52,6 +53,7 @@ func TestModuleWithTestEnv(t *testing.T) { ).RequireStart().RequireStop() assert.Equal(t, "test-app", cfg.AppName()) + assert.Equal(t, "test-description", cfg.AppDescription()) assert.Equal(t, config.AppEnvTest, cfg.AppEnv()) assert.False(t, cfg.IsDevEnv()) assert.True(t, cfg.IsTestEnv()) @@ -80,6 +82,7 @@ func TestModuleWithCustomEnv(t *testing.T) { ).RequireStart().RequireStop() assert.Equal(t, "custom-app", cfg.AppName()) + assert.Equal(t, "custom-description", cfg.AppDescription()) assert.Equal(t, "custom", cfg.AppEnv()) assert.False(t, cfg.IsDevEnv()) assert.False(t, cfg.IsTestEnv()) diff --git a/fxconfig/testdata/config/config.custom.yaml b/fxconfig/testdata/config/config.custom.yaml index 9ea088c7..059528b2 100644 --- a/fxconfig/testdata/config/config.custom.yaml +++ b/fxconfig/testdata/config/config.custom.yaml @@ -1,5 +1,6 @@ app: name: custom-app + description: custom-description env: custom debug: true config: diff --git a/fxconfig/testdata/config/config.test.yaml b/fxconfig/testdata/config/config.test.yaml index c6550c9f..d156766d 100644 --- a/fxconfig/testdata/config/config.test.yaml +++ b/fxconfig/testdata/config/config.test.yaml @@ -1,5 +1,6 @@ app: name: test-app + description: test-description env: test debug: true config: diff --git a/fxconfig/testdata/config/config.yaml b/fxconfig/testdata/config/config.yaml index 323e37a6..c37487cb 100644 --- a/fxconfig/testdata/config/config.yaml +++ b/fxconfig/testdata/config/config.yaml @@ -1,5 +1,6 @@ app: name: default-app + description: default-description env: dev version: 0.1.0 debug: false