summaryrefslogtreecommitdiffhomepage
path: root/table/table.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-12-25 05:59:42 -0800
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-12-25 05:59:42 -0800
commitd9d527a65dd068e0a093ed94ad5effc13567a5e1 (patch)
tree389a48290c084887a85e43918971ebdfff2bc5f8 /table/table.go
parent40819efb0c592d8a23da8bec0006014b43321ac4 (diff)
table: make table json prettier
Even 'jq' command makes the output very nicer. $ curl http://localhost:8080/v1/bgp/neighbor/10.0.0.1/local-rib |jq '.' Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'table/table.go')
-rw-r--r--table/table.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/table/table.go b/table/table.go
index df55947b..a9d742aa 100644
--- a/table/table.go
+++ b/table/table.go
@@ -55,12 +55,11 @@ func (td *TableDefault) MarshalJSON() ([]byte, error) {
for _, dest := range td.destinations {
destList = append(destList, dest)
}
- j, _ := json.Marshal(destList)
return json.Marshal(struct {
- Destinations string
+ Destinations []Destination
}{
- Destinations: string(j),
+ Destinations: destList,
})
}