From b1b366ac99c06cedff8f0ffc808649f27fa98c42 Mon Sep 17 00:00:00 2001 From: Silvan Jegen Date: Sun, 19 Feb 2017 18:16:51 +0100 Subject: Use a setter to set the Work error --- input/stdin/stdin.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'input/stdin/stdin.go') diff --git a/input/stdin/stdin.go b/input/stdin/stdin.go index 394b952..4421741 100644 --- a/input/stdin/stdin.go +++ b/input/stdin/stdin.go @@ -33,10 +33,15 @@ func (i *StdinInput) Start() chan *work.Work { if err == io.EOF { break } + + w := &work.Work{Data: bs} + if err != nil { fmt.Printf("Error when reading input from Stdin: %q", err) + w.SetError(err) } - i.retchan <- &work.Work{Data: bs, Err: err} + + i.retchan <- w } close(i.retchan) }() -- cgit v1.2.1-18-gbd029