From e34cf57aa7ee8825210005b968097b364483b5ed Mon Sep 17 00:00:00 2001 From: luopengift <870148195@qq.com> Date: Sun, 17 Sep 2017 21:30:58 +0800 Subject: [PATCH] Update input plugin exec --- plugins/input/exec/exec.go | 24 ++++++++++++------------ test/scripts/go.go | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/plugins/input/exec/exec.go b/plugins/input/exec/exec.go index 299ba70..a6f72b2 100644 --- a/plugins/input/exec/exec.go +++ b/plugins/input/exec/exec.go @@ -11,8 +11,8 @@ const ( ) type ExecInput struct { - Commands []string `json:"commands"` - Crontab string `json:"cron"` + Commands []string `json:"commands"` + Crontab string `json:"cron"` result chan []byte errchan chan error @@ -30,16 +30,16 @@ func (in *ExecInput) Init(config transport.Configer) error { } in.result = make(chan []byte, 1) in.errchan = make(chan error, 1) - for _, command := range in.Commands { - cmd := command - transport.AddCronTask( - cmd, - in.Crontab, - func() error { - return in.run(cmd) - }, - ) - } + for _, command := range in.Commands { + cmd := command + transport.AddCronTask( + cmd, + in.Crontab, + func() error { + return in.run(cmd) + }, + ) + } return nil } diff --git a/test/scripts/go.go b/test/scripts/go.go index 3648f0a..dca427c 100644 --- a/test/scripts/go.go +++ b/test/scripts/go.go @@ -3,5 +3,5 @@ package main import "fmt" func main() { - fmt.Println("golang program testing...") + fmt.Println("golang program testing...") }