mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-21 20:26:41 +00:00
cmd/utils: keep metrics tag values containing '='
SplitTagsFlag split each "k=v" tag on every "=" with strings.Split, producing more than two parts whenever the value itself contained an "=" (e.g. build=release=2026). Such a tag failed the len(kv) == 2 check and was silently dropped. Use strings.SplitN(t, "=", 2) so the split happens only on the first "=", keeping the remainder as the value. A tag list like 'host=node1,build=release=2026' now retains the build tag.
This commit is contained in:
parent
eea6242742
commit
5bc59de935
1 changed files with 1 additions and 1 deletions
|
|
@ -2268,7 +2268,7 @@ func SplitTagsFlag(tagsFlag string) map[string]string {
|
|||
|
||||
for _, t := range tags {
|
||||
if t != "" {
|
||||
kv := strings.Split(t, "=")
|
||||
kv := strings.SplitN(t, "=", 2)
|
||||
|
||||
if len(kv) == 2 {
|
||||
tagsMap[kv[0]] = kv[1]
|
||||
|
|
|
|||
Loading…
Reference in a new issue