salapenar-max opened a new pull request, #3758: URL: https://github.com/apache/dubbo-go/pull/3758
## What `makeNestedMap` turns flat Apollo properties into a nested map for YAML namespaces. When one key is a prefix of another (`a.b=1` and `a.b.c=2`), the intermediate value is a string. The old type assertion then panics. That is item 3 in #3552. ## Fix The descent now uses a comma-ok check. If the value already stored is not a map, it is replaced with one. If a scalar arrives after the nested map exists, the map is kept so the longer key is not erased. Either visit order keeps `a.b.c` and drops the conflicting scalar. Keys that do not overlap are unchanged. This pull request covers only that panic. It does not take the rest of #3552, so it uses `Refs` instead of `Fixes` and should not close the issue. The forking-cluster goroutine leak already has an open pull request, #3436. ## Tests `go test -count=1 ./config_center/apollo/` `TestMakeNestedMap` checks ordinary dotted keys, and it repeats the leaf-and-parent case so both map-iteration orders stay panic-free and keep the nested value plus the sibling key. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
