1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-11-24 08:02:32 +02:00

fix(config/source/cli): mergo.Map error, src and dst must be of same … (#2628)

This commit is contained in:
Coder 2023-04-26 08:21:08 +08:00 committed by GitHub
parent ad8fca255b
commit 1478a8e46d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)