census-service: remove \u0000 character from dump

Signed-off-by: p4u <p4u@dabax.net>
This commit is contained in:
p4u
2019-02-20 19:51:02 +01:00
parent f40dfc6ae0
commit ddda6bfa62

View File

@@ -118,6 +118,7 @@ func (t *Tree) Dump() ([]string, error) {
err := t.Tree.Walk(nil, func(n *merkletree.Node) {
if n.Type == merkletree.NodeTypeLeaf {
data := bytes.Trim(n.Value()[65:], "\x00")
data = bytes.Replace(data, []byte("\u0000"), nil, -1)
response = append(response, fmt.Sprintf("%s", data))
}
})