fix lint
Some checks failed
build / lint (push) Successful in 53s
build / test (push) Failing after 56s
codeql / analyze (go) (push) Failing after 10m5s

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2024-12-12 10:23:39 +03:00
parent e943421543
commit 56bfb287f4

8
env.go
View File

@ -8,7 +8,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"dario.cat/mergo" "dario.cat/mergo"
"go.unistack.org/micro/v4/config" "go.unistack.org/micro/v4/config"
"go.unistack.org/micro/v4/options" "go.unistack.org/micro/v4/options"
rutil "go.unistack.org/micro/v4/util/reflect" 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 { func (c *envConfig) Init(opts ...options.Option) error {
var err error
for _, o := range opts { 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 { if err := config.DefaultBeforeInit(c.opts.Context, c); err != nil && !c.opts.AllowFail {