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:
6
task.go
6
task.go
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user