Skip to content

fix: alias values were not being set properly#53

Open
FerroEduardo wants to merge 2 commits intotakenet:mainfrom
FerroEduardo:fix/alias
Open

fix: alias values were not being set properly#53
FerroEduardo wants to merge 2 commits intotakenet:mainfrom
FerroEduardo:fix/alias

Conversation

@FerroEduardo
Copy link
Copy Markdown
Contributor

As values are read using internal/config/viper_config.go, it is unnecessary to use viper.SetDefault(), as the default value from ViperConfigKey is used if the variable is not set.

func (config *ViperConfigKey) Get() string {
if viper.IsSet(config.Key) {
return viper.GetString(config.Key)
}
for _, alias := range config.GetAliases() {
if viper.IsSet(alias) {
return viper.GetString(alias)
}
}
if val, ok := config.GetDefault().(string); ok {
return val
}
return ""
}

Fixes #51

@codecov
Copy link
Copy Markdown

codecov bot commented Oct 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.19%. Comparing base (5a2182c) to head (26a946f).
Report is 31 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main      #53       +/-   ##
===========================================
- Coverage   82.11%   68.19%   -13.93%     
===========================================
  Files          26       30        +4     
  Lines        3696     4823     +1127     
===========================================
+ Hits         3035     3289      +254     
- Misses        519     1384      +865     
- Partials      142      150        +8     
Files with missing lines Coverage Δ
internal/config/config.go 84.21% <ø> (-4.26%) ⬇️

... and 5 files with indirect coverage changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Configuration DECKARD_MONGODB_DATABASE is not working

3 participants