Skip to content

Commit

Permalink
feat: add mapstructure name tag support to config struct for viper dy… (
Browse files Browse the repository at this point in the history
#51)

* feat: add mapstructure name tag support to config struct for viper dynamic config compatibility

Signed-off-by: Emre Kosen <[email protected]>

---------

Signed-off-by: Emre Kosen <[email protected]>
  • Loading branch information
emrekosen authored Dec 15, 2023
1 parent 20a1c34 commit d218332
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit d218332

Please sign in to comment.