From a9e71a172c6c64aee031c52fb60564f107a43d04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E4=BD=B3=E5=85=B4?= Date: Wed, 12 Apr 2023 21:58:18 +0800 Subject: [PATCH] fix(config/source/cli): mergo.Map error, src and dst must be of same type error --- config/source/cli/cli.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/source/cli/cli.go b/config/source/cli/cli.go index b12d2d9ff1..3a70f8d680 100644 --- a/config/source/cli/cli.go +++ b/config/source/cli/cli.go @@ -25,7 +25,9 @@ func (c *cliSource) Read() (*source.ChangeSet, error) { for _, f := range c.ctx.App.Flags { name := f.Names()[0] tmp := toEntry(name, c.ctx.Generic(name)) - mergo.Map(&changes, tmp) // need to sort error handling + if err := mergo.Map(&changes, tmp, mergo.WithOverride); err != nil { + return nil, err + } } b, err := c.opts.Encoder.Encode(changes)