From b22f4d4b6b526ebced1e980c422dfe41d505bcce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Senart?= Date: Sat, 18 Aug 2018 23:58:28 +0200 Subject: [PATCH] plot: Reuse decoder helper in plot --- plot.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/plot.go b/plot.go index 8efee2e1..3ed11bc0 100644 --- a/plot.go +++ b/plot.go @@ -60,16 +60,11 @@ func plotCmd() command { } func plotRun(files []string, threshold int, title, output string) error { - srcs := make([]vegeta.Decoder, len(files)) - for i, f := range files { - in, err := file(f, false) - if err != nil { - return err - } - defer in.Close() - srcs[i] = vegeta.NewDecoder(in) + dec, mc, err := decoder(files) + defer mc.Close() + if err != nil { + return err } - dec := vegeta.NewRoundRobinDecoder(srcs...) out, err := file(output, true) if err != nil {