diff --git a/README.md b/README.md index b5b0171..3e0ec9b 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -# micro-config-consul \ No newline at end of file +# micro-config-file diff --git a/file.go b/file.go index c6e88cf..c87767a 100644 --- a/file.go +++ b/file.go @@ -13,7 +13,6 @@ import ( var ( DefaultStructTag = "file" - ErrInvalidStruct = errors.New("invalid struct specified") ErrPathNotExist = errors.New("path is not exist") ) @@ -39,6 +38,10 @@ func (c *fileConfig) Init(opts ...config.Option) error { } } + if path == "" { + return ErrPathNotExist + } + c.path = path return nil diff --git a/go.mod b/go.mod index e735675..08d0fb9 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module github.com/unistack-org/micro-config-file go 1.15 -require github.com/unistack-org/micro/v3 v3.0.2-0.20201207213837-b7b28f6b9add +require github.com/unistack-org/micro/v3 v3.0.2-0.20201213102644-92aec349c3d4 diff --git a/go.sum b/go.sum index 456ea18..2785182 100644 --- a/go.sum +++ b/go.sum @@ -239,8 +239,8 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/timewasted/linode v0.0.0-20160829202747-37e84520dcf7/go.mod h1:imsgLplxEC/etjIhdr3dNzV3JeT27LbVu5pYWm0JCBY= github.com/transip/gotransip v0.0.0-20190812104329-6d8d9179b66f/go.mod h1:i0f4R4o2HM0m3DZYQWsj6/MEowD57VzoH0v3d7igeFY= github.com/uber-go/atomic v1.3.2/go.mod h1:/Ct5t2lcmbJ4OSe/waGBoaVvVqtO0bmtfVNex1PFV8g= -github.com/unistack-org/micro/v3 v3.0.2-0.20201207213837-b7b28f6b9add h1:WW28bP8gthVh/PmfIzvdOOq0hnsieyVrQjuUEvz/pPQ= -github.com/unistack-org/micro/v3 v3.0.2-0.20201207213837-b7b28f6b9add/go.mod h1:0DgOy4OdJxQCDER8YSKitZugd2+1bddrRSNfeooTHDc= +github.com/unistack-org/micro/v3 v3.0.2-0.20201213102644-92aec349c3d4 h1:SmwEx/EYb7iUOdDZHiamtwRFfnhiZjtzmVdLZq+KQM0= +github.com/unistack-org/micro/v3 v3.0.2-0.20201213102644-92aec349c3d4/go.mod h1:0DgOy4OdJxQCDER8YSKitZugd2+1bddrRSNfeooTHDc= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/vultr/govultr v0.1.4/go.mod h1:9H008Uxr/C4vFNGLqKx232C206GL0PBHzOP0809bGNA= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=