From d93e50cbfb3ba8c660864b4bcb25db6931c5cb67 Mon Sep 17 00:00:00 2001 From: harshitha-yb Date: Wed, 4 Sep 2024 07:12:37 +0000 Subject: [PATCH] Add json output for cluster node list command --- internal/formatter/nodes.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/formatter/nodes.go b/internal/formatter/nodes.go index b6044aee..a8d79ac1 100644 --- a/internal/formatter/nodes.go +++ b/internal/formatter/nodes.go @@ -16,6 +16,7 @@ package formatter import ( + "encoding/json" "fmt" "runtime" "sort" @@ -122,9 +123,9 @@ func (n *NodeContext) MemoryUsed() string { // return e.e.GetHost() // } -// func (n *NodeContext) MarshalJSON() ([]byte, error) { -// return json.Marshal(e.e) -// } +func (n *NodeContext) MarshalJSON() ([]byte, error) { + return json.Marshal(n.n) +} func NodeTypeToEmoji(nodeType bool) string {