daemon/events: use strings.Cut()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
5008409b5c
commit
32c4c15f15
1 changed files with 3 additions and 3 deletions
|
@ -57,9 +57,9 @@ func Scan(text string) (*events.Message, error) {
|
|||
}
|
||||
|
||||
attrs := make(map[string]string)
|
||||
for _, a := range strings.SplitN(md["attributes"], ", ", -1) {
|
||||
kv := strings.SplitN(a, "=", 2)
|
||||
attrs[kv[0]] = kv[1]
|
||||
for _, a := range strings.Split(md["attributes"], ", ") {
|
||||
k, v, _ := strings.Cut(a, "=")
|
||||
attrs[k] = v
|
||||
}
|
||||
|
||||
return &events.Message{
|
||||
|
|
Loading…
Add table
Reference in a new issue