Bugfix: bx in etcd.go didn't get Key

Thus record only diffing in the Key were seen as identical and not
included in the end results. Of course this being a map when and if
this would happen was rather random.

Fixed by including Key. Further small tweaks and code refactors.
This commit is contained in:
Miek Gieben
2016-03-25 15:30:44 +00:00
parent e408c81a8c
commit e62eb2cde0
4 changed files with 38 additions and 34 deletions

View File

@@ -103,7 +103,7 @@ Nodes:
if err := json.Unmarshal([]byte(n.Value), serv); err != nil {
return nil, err
}
b := msg.Service{Host: serv.Host, Port: serv.Port, Priority: serv.Priority, Weight: serv.Weight, Text: serv.Text}
b := msg.Service{Host: serv.Host, Port: serv.Port, Priority: serv.Priority, Weight: serv.Weight, Text: serv.Text, Key: n.Key}
if _, ok := bx[b]; ok {
continue
}