mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-04 20:21:15 +00:00
cmd/utils: keep metrics tag values containing '=' (#35168)
This commit is contained in:
parent
d617f4fcdb
commit
aa3d286f54
2 changed files with 4 additions and 2 deletions
|
|
@ -2284,7 +2284,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]
|
||||
|
|
|
|||
|
|
@ -52,7 +52,9 @@ func Test_SplitTagsFlag(t *testing.T) {
|
|||
{
|
||||
"garbage",
|
||||
"smth=smthelse=123",
|
||||
map[string]string{},
|
||||
map[string]string{
|
||||
"smth": "smthelse=123",
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
|
|
|
|||
Loading…
Reference in a new issue