From ec3ae6b9345fbacd4a2b138f3bac0e4d32a6a1cf Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Thu, 12 Dec 2024 11:39:15 +0300 Subject: [PATCH] fix lint Signed-off-by: Vasiliy Tolstov --- flag.go | 6 +++++- util.go | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/flag.go b/flag.go index 083cd50..9b4e2a2 100644 --- a/flag.go +++ b/flag.go @@ -41,8 +41,12 @@ func (c *flagConfig) Options() config.Options { } func (c *flagConfig) 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 { diff --git a/util.go b/util.go index 8f9c704..4dba12b 100644 --- a/util.go +++ b/util.go @@ -325,6 +325,7 @@ func (c *flagConfig) flagFloat64(v reflect.Value, fn, fv, fd string) error { return nil } +/* func (c *flagConfig) flagStringSlice(v reflect.Value, fn, fv, fd string) error { nv, ok := v.Addr().Interface().(*string) if !ok { @@ -333,6 +334,7 @@ func (c *flagConfig) flagStringSlice(v reflect.Value, fn, fv, fd string) error { flag.StringVar(nv, fn, fv, fd) return nil } +*/ func getFlagOpts(tf string) (string, string, string) { var name, desc, def string