climc: 在打印路由条目时显示下一跳资源id

This commit is contained in:
Yousong Zhou
2019-05-21 09:38:14 +00:00
parent e3b89c7f0a
commit 924f9cc24e
+3 -3
View File
@@ -39,10 +39,10 @@ func init() {
typ, _ := routeObj.GetString("type")
cidr, _ := routeObj.GetString("cidr")
next_hop_type, _ := routeObj.GetString("next_hop_type")
next_hop, _ := routeObj.GetString("next_hop")
next_hop_id, _ := routeObj.GetString("next_hop_id")
route := fmt.Sprintf("%8s: %18s %s", typ, cidr, next_hop_type)
if len(next_hop) > 0 {
route += fmt.Sprintf(":%s", next_hop)
if next_hop_id != "" {
route += fmt.Sprintf(":%s", next_hop_id)
}
routes = append(routes, route)
}