From f4561e1d940223afac15087ec845ef6020db501f Mon Sep 17 00:00:00 2001 From: beanjs <445212619@qq.com> Date: Wed, 27 Jul 2022 18:03:52 +0800 Subject: [PATCH] remove empty string output --- plugin.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugin.go b/plugin.go index 3317966..48b2e0b 100644 --- a/plugin.go +++ b/plugin.go @@ -127,9 +127,13 @@ func (p Plugin) exec(host string, wg *sync.WaitGroup, errChannel chan error) { case isTimeout = <-doneChan: break loop case outline := <-stdoutChan: - p.log(host, "out:", outline) + if outline != "" { + p.log(host, "out:", outline) + } case errline := <-stderrChan: - p.log(host, "err:", errline) + if errline != "" { + p.log(host, "err:", errline) + } case err = <-errChan: } }