Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: alias values were not being set properly #53

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

FerroEduardo
Copy link
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

Copy link

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 27 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
2 participants