MCPcopy
hub / github.com/spf13/viper / WithFinder

Function WithFinder

finder.go:10–18  ·  view source on GitHub ↗

WithFinder sets a custom [Finder].

(f Finder)

Source from the content-addressed store, hash-verified

8
9// WithFinder sets a custom [Finder].
10func WithFinder(f Finder) Option {
11 return optionFunc(func(v *Viper) {
12 if f == nil {
13 return
14 }
15
16 v.finder = f
17 })
18}
19
20// Finder looks for files and directories in an [afero.Fs] filesystem.
21type Finder interface {

Callers 4

ExampleFinderFunction · 0.92
ExampleFindersFunction · 0.92
TestGetConfigFileFunction · 0.85
TestReadInConfigFunction · 0.85

Calls 1

optionFuncFuncType · 0.85

Tested by 4

ExampleFinderFunction · 0.74
ExampleFindersFunction · 0.74
TestGetConfigFileFunction · 0.68
TestReadInConfigFunction · 0.68