From 56bfb287f46ac2409ff2df5ca4c89f15e036cada Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Thu, 12 Dec 2024 10:23:39 +0300 Subject: [PATCH] fix lint Signed-off-by: Vasiliy Tolstov --- env.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/env.go b/env.go index 61588cb..523cc97 100644 --- a/env.go +++ b/env.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" -"dario.cat/mergo" + "dario.cat/mergo" "go.unistack.org/micro/v4/config" "go.unistack.org/micro/v4/options" rutil "go.unistack.org/micro/v4/util/reflect" @@ -25,8 +25,12 @@ func (c *envConfig) Options() config.Options { } func (c *envConfig) Init(opts ...options.Option) error { + var err error + for _, o := range opts { - o(&c.opts) + if err = o(&c.opts); err != nil { + return err + } } if err := config.DefaultBeforeInit(c.opts.Context, c); err != nil && !c.opts.AllowFail {