summaryrefslogtreecommitdiff
path: root/input/stdin
diff options
context:
space:
mode:
authorSilvan Jegen <s.jegen@gmail.com>2017-02-19 18:16:51 +0100
committerSilvan Jegen <s.jegen@gmail.com>2017-02-19 18:16:51 +0100
commitb1b366ac99c06cedff8f0ffc808649f27fa98c42 (patch)
treec9b22b3e1616384ace12bcf2d134027739fab847 /input/stdin
parentf1eb4962060267458883f86bb5f4093b9b1afc47 (diff)
Use a setter to set the Work error
Diffstat (limited to 'input/stdin')
-rw-r--r--input/stdin/stdin.go7
1 files changed, 6 insertions, 1 deletions
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)
}()