distribworks/dkron

Should output.TotalWritten be judged after cmd.Wait() is executed?

cobolbaby opened this issue · 1 comments

// Warn if buffer is overwritten
if output.TotalWritten() > output.Size() {
log.Printf("shell: Script '%s' generated %d bytes of output, truncated to %d", command, output.TotalWritten(), output.Size())
}
err = cmd.Wait()

Should output.TotalWritten be judged after cmd.Wait() is executed?

Yes, it makes sense.