Skip to content
This repository was archived by the owner on Nov 7, 2024. It is now read-only.

Commit e04eb7d

Browse files
committed
Do not fail when no config file is provided
1 parent dbba395 commit e04eb7d

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

configor.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@ func New(config *Config) *Configor {
3434
return &Configor{Config: config}
3535
}
3636

37-
var (
38-
// ErrNoConfigFiles is returned by Load when no files from the given list
39-
// could be found.
40-
ErrNoConfigFiles = errors.New("could not find any configuration files")
41-
)
42-
4337
// Load will decode the given files into `config` using default settings.
4438
func Load(config interface{}, files ...string) (err error) {
4539
return New(nil).Load(config, files...)
@@ -48,9 +42,6 @@ func Load(config interface{}, files ...string) (err error) {
4842
// Load will decode the given files into `config`
4943
func (configor *Configor) Load(config interface{}, files ...string) (err error) {
5044
configFiles := configor.getConfigurationFiles(files...)
51-
if len(configFiles) == 0 {
52-
return ErrNoConfigFiles
53-
}
5445

5546
for _, file := range configFiles {
5647
if err := UnmarshalFile(config, file, configor.ErrorOnUnmatchedKeys); err != nil {

0 commit comments

Comments
 (0)