From f964e7fa891079828283240db3d2c0dd91fd0aa6 Mon Sep 17 00:00:00 2001 From: liruichen Date: Mon, 11 Sep 2023 16:25:08 +0800 Subject: [PATCH] fix: print json --- pkg/client/agent.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/client/agent.go b/pkg/client/agent.go index fdc8415..2002b68 100644 --- a/pkg/client/agent.go +++ b/pkg/client/agent.go @@ -79,9 +79,10 @@ asJson: } if !isJson { table.Render() + } else { + b, _ := json.Marshal(agents) + fmt.Fprint(os.Stdout, string(b)) } - b, _ := json.Marshal(agents) - fmt.Fprint(os.Stdout, string(b)) } func DeleteAgents(host string, ids []string) {