File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 7
7
8
8
"github.com/ghodss/yaml"
9
9
"github.com/jedib0t/go-pretty/v6/table"
10
+
10
11
corepb "github.com/projecteru2/core/rpc/gen"
11
12
)
12
13
@@ -56,16 +57,20 @@ func describeAsJSON(o interface{}) {
56
57
}
57
58
58
59
func describeChNodeAsJSON (ch chan * corepb.Node ) {
60
+ nodes := []* corepb.Node {}
59
61
for t := range ch {
60
- j , _ := json .MarshalIndent (t , "" , " " )
61
- fmt .Println (string (j ))
62
+ nodes = append (nodes , t )
62
63
}
64
+ j , _ := json .MarshalIndent (nodes , "" , " " )
65
+ fmt .Println (string (j ))
63
66
}
64
67
func describeChNodeResourceAsJSON (ch chan * corepb.NodeResource ) {
68
+ nodes := []* corepb.NodeResource {}
65
69
for t := range ch {
66
- j , _ := json .MarshalIndent (t , "" , " " )
67
- fmt .Println (string (j ))
70
+ nodes = append (nodes , t )
68
71
}
72
+ j , _ := json .MarshalIndent (nodes , "" , " " )
73
+ fmt .Println (string (j ))
69
74
}
70
75
71
76
func describeAsYAML (o interface {}) {
You can’t perform that action at this time.
0 commit comments