1
0
mirror of https://github.com/go-task/task.git synced 2025-06-23 00:38:19 +02:00

refactor: better usage of bytes.Buffer type

This commit is contained in:
Andrey Nering
2017-07-08 14:57:12 -03:00
parent 50f592c540
commit ff1c49f111
2 changed files with 8 additions and 10 deletions

View File

@ -284,12 +284,12 @@ func (e *Executor) runCommand(ctx context.Context, call Call, i int) error {
return err
}
} else {
buff := bytes.NewBuffer(nil)
opts.Stdout = buff
var stdout bytes.Buffer
opts.Stdout = &stdout
if err = execext.RunCommand(opts); err != nil {
return err
}
os.Setenv(t.Set, strings.TrimSpace(buff.String()))
os.Setenv(t.Set, strings.TrimSpace(stdout.String()))
}
return nil
}