From 9079f59b7f08a958968b5d6989112eb32d3564b0 Mon Sep 17 00:00:00 2001 From: Emre Kosen Date: Mon, 11 Dec 2023 15:02:36 +0300 Subject: [PATCH] feat: add mapstructure name tag support to config struct for viper dynamic config compatibility 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 0f54232..be36886 100644 --- a/config/config.go +++ b/config/config.go @@ -40,8 +40,8 @@ func (k *Kafka) GetCompression() int8 { } type Connector struct { - Kafka Kafka `yaml:"kafka"` - Dcp config.Dcp `yaml:",inline"` + Kafka Kafka `yaml:"kafka" mapstructure:"kafka"` + Dcp config.Dcp `yaml:",inline" mapstructure:",squash"` } func (c *Connector) ApplyDefaults() {