Skip to content

Config Path Priority #1191

Answered by sagikazarmark
Quyzi asked this question in Q&A
Discussion options

You must be logged in to vote

Viper traverses the list of config paths in the order they are added. If it finds a config file, it stops searching.

viper/viper.go

Lines 2130 to 2135 in cf6565f

for _, cp := range v.configPaths {
file := v.searchInPath(cp)
if file != "" {
return file, nil
}
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sagikazarmark
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants