From 40c5c34b12616292369780f72246145690cb4f3a Mon Sep 17 00:00:00 2001 From: crusader Date: Thu, 9 Nov 2017 15:26:30 +0900 Subject: [PATCH] ing --- config.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config.go b/config.go index a1a81be..0cc0b25 100644 --- a/config.go +++ b/config.go @@ -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