From d21833265b92eb20e6942cb51552e648d72703c2 Mon Sep 17 00:00:00 2001 From: Emre <30931704+emrekosen@users.noreply.github.com> Date: Fri, 15 Dec 2023 10:32:17 +0300 Subject: [PATCH] =?UTF-8?q?feat:=20add=20mapstructure=20name=20tag=20suppo?= =?UTF-8?q?rt=20to=20config=20struct=20for=20viper=20dy=E2=80=A6=20(#51)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add mapstructure name tag support to config struct for viper dynamic config compatibility Signed-off-by: Emre Kosen --------- Signed-off-by: Emre Kosen --- config/config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/config.go b/config/config.go index e3fb31a..19def1a 100644 --- a/config/config.go +++ b/config/config.go @@ -24,8 +24,8 @@ type Elasticsearch struct { } type Config struct { - Elasticsearch Elasticsearch `yaml:"elasticsearch"` - Dcp config.Dcp `yaml:",inline"` + Elasticsearch Elasticsearch `yaml:"elasticsearch" mapstructure:"elasticsearch"` + Dcp config.Dcp `yaml:",inline" mapstructure:",squash"` } func (c *Config) ApplyDefaults() {