mirror of
https://github.com/bcicen/ctop.git
synced 2024-08-30 18:23:19 +00:00
handle single kv pair given to NewMeta
This commit is contained in:
parent
22a5607012
commit
50d1c29d57
@ -14,14 +14,10 @@ type Meta map[string]string
|
||||
func NewMeta(kvs ...string) Meta {
|
||||
m := make(Meta)
|
||||
|
||||
var k string
|
||||
for i := 0; i < len(kvs)-1; i++ {
|
||||
if k == "" {
|
||||
k = kvs[i]
|
||||
} else {
|
||||
m[k] = kvs[i]
|
||||
k = ""
|
||||
}
|
||||
var i int
|
||||
for i < len(kvs)-1 {
|
||||
m[kvs[i]] = kvs[i+1]
|
||||
i += 2
|
||||
}
|
||||
|
||||
return m
|
||||
|
Loading…
Reference in New Issue
Block a user