Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions multiconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ func NewWithPath(path string) *DefaultLoader {
return d
}

// NewWithPathOptional returns a new instance of DefaultLoader with given file optinal.
func NewWithPathOptional(path string) *DefaultLoader {
_, err := os.Stat(path)
if os.IsNotExist(err) {
return New()
}
return NewWithPath(path)
}

// New returns a new instance of DefaultLoader without any file loaders.
func New() *DefaultLoader {
loader := MultiLoader(
Expand Down