update deps

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-10-27 22:56:15 +03:00
parent bfff6a7e87
commit 2089311c85
4 changed files with 7 additions and 7 deletions

View File

@ -52,6 +52,7 @@ func (c *flagConfig) Init(opts ...config.Option) error {
fn, fv, fd := getFlagOpts(tf) fn, fv, fd := getFlagOpts(tf)
rcheck := true rcheck := true
switch sf.Value.Interface().(type) { switch sf.Value.Interface().(type) {
case time.Duration: case time.Duration:
err = c.flagDuration(sf.Value, fn, fv, fd) err = c.flagDuration(sf.Value, fn, fv, fd)
@ -60,6 +61,7 @@ func (c *flagConfig) Init(opts ...config.Option) error {
err = c.flagTime(sf.Value, fn, fv, fd) err = c.flagTime(sf.Value, fn, fv, fd)
rcheck = false rcheck = false
} }
if err != nil { if err != nil {
c.opts.Logger.Errorf(c.opts.Context, "flag init error: %v", err) c.opts.Logger.Errorf(c.opts.Context, "flag init error: %v", err)
if !c.opts.AllowFail { if !c.opts.AllowFail {

View File

@ -30,11 +30,11 @@ func TestLoad(t *testing.T) {
c := NewConfig(config.Struct(cfg), TimeFormat(time.RFC822)) c := NewConfig(config.Struct(cfg), TimeFormat(time.RFC822))
if err := c.Init(); err != nil { if err := c.Init(); err != nil {
t.Fatal(err) t.Fatalf("init failed: %v", err)
} }
if err := c.Load(ctx); err != nil { if err := c.Load(ctx); err != nil {
t.Fatal(err) t.Fatalf("load failed: %v", err)
} }
if cfg.Broker != "5566:33" { if cfg.Broker != "5566:33" {
@ -43,6 +43,4 @@ func TestLoad(t *testing.T) {
if tf := cfg.Time.Format(time.RFC822); tf != "02 Jan 06 14:32 MSK" { if tf := cfg.Time.Format(time.RFC822); tf != "02 Jan 06 14:32 MSK" {
t.Fatalf("parse time error: %v", cfg.Time) t.Fatalf("parse time error: %v", cfg.Time)
} }
t.Logf("cfg %#+v", cfg)
} }

2
go.mod
View File

@ -2,4 +2,4 @@ module go.unistack.org/micro-config-flag/v3
go 1.16 go 1.16
require go.unistack.org/micro/v3 v3.8.5 require go.unistack.org/micro/v3 v3.8.7

4
go.sum
View File

@ -9,8 +9,8 @@ github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTK
github.com/silas/dag v0.0.0-20210626123444-3804bac2d6d4/go.mod h1:7RTUFBdIRC9nZ7/3RyRNH1bdqIShrDejd1YbLwgPS+I= github.com/silas/dag v0.0.0-20210626123444-3804bac2d6d4/go.mod h1:7RTUFBdIRC9nZ7/3RyRNH1bdqIShrDejd1YbLwgPS+I=
go.unistack.org/micro-proto/v3 v3.1.0 h1:q39FwjFiRZn+Ux/tt+d3bJTmDtsQQWa+3SLYVo1vLfA= go.unistack.org/micro-proto/v3 v3.1.0 h1:q39FwjFiRZn+Ux/tt+d3bJTmDtsQQWa+3SLYVo1vLfA=
go.unistack.org/micro-proto/v3 v3.1.0/go.mod h1:DpRhYCBXlmSJ/AAXTmntvlh7kQkYU6eFvlmYAx4BQS8= go.unistack.org/micro-proto/v3 v3.1.0/go.mod h1:DpRhYCBXlmSJ/AAXTmntvlh7kQkYU6eFvlmYAx4BQS8=
go.unistack.org/micro/v3 v3.8.5 h1:DIYWRsQF+NPhKZP45sCtNsUhaRw6u2+Ps7U+pKU7i3s= go.unistack.org/micro/v3 v3.8.7 h1:k1zOpJ3uS8MxdhK8annRsa5J/LW7MpqPjwYuekW61wE=
go.unistack.org/micro/v3 v3.8.5/go.mod h1:KMMmOmbgo/D52/rCAbqeKbBsgEEbSKM69he54J3ZIuA= go.unistack.org/micro/v3 v3.8.7/go.mod h1:KMMmOmbgo/D52/rCAbqeKbBsgEEbSKM69he54J3ZIuA=
golang.org/x/net v0.0.0-20210928044308-7d9f5e0b762b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210928044308-7d9f5e0b762b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=