ing
This commit is contained in:
parent
dcd0b68205
commit
40c5c34b12
|
@ -2,6 +2,7 @@ package config
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
@ -65,6 +66,10 @@ func Load(target interface{}, files ...string) error {
|
|||
func (c *config) Load(target interface{}, files ...string) error {
|
||||
filenames := c.getConfigFiles(files...)
|
||||
|
||||
if 0 == len(filenames) {
|
||||
return fmt.Errorf("Config: have no config files in [%v]", files)
|
||||
}
|
||||
|
||||
for _, file := range filenames {
|
||||
if err := unmarshalFile(target, file); err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue
Block a user