Add option to flush after each line of input (#244)
Este cometimento está contido em:
ascendente
3c17bf32e8
cometimento
a9fc785eb0
|
@ -20,6 +20,7 @@ type Config struct {
|
|||
LocalAddress string `long:"source-ip" description:"Local source IP address to use for making connections"`
|
||||
Senders int `short:"s" long:"senders" default:"1000" description:"Number of send goroutines to use"`
|
||||
Debug bool `long:"debug" description:"Include debug fields in the output."`
|
||||
Flush bool `long:"flush" description:"Flush after each line of output."`
|
||||
GOMAXPROCS int `long:"gomaxprocs" default:"0" description:"Set GOMAXPROCS"`
|
||||
ConnectionsPerHost int `long:"connections-per-host" default:"1" description:"Number of times to connect to each host (results in more output)"`
|
||||
ReadLimitPerHost int `long:"read-limit-per-host" default:"96" description:"Maximum total kilobytes to read for a single host (default 96kb)"`
|
||||
|
|
|
@ -153,6 +153,9 @@ func OutputResults(w *bufio.Writer, results <-chan []byte) error {
|
|||
if err := w.WriteByte('\n'); err != nil {
|
||||
return err
|
||||
}
|
||||
if config.Flush {
|
||||
out.Flush()
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Carregando…
Criar uma nova questão referindo esta