summaryrefslogtreecommitdiff
path: root/output/http
diff options
context:
space:
mode:
authorSilvan Jegen <s.jegen@gmail.com>2017-02-14 14:37:12 +0100
committerSilvan Jegen <s.jegen@gmail.com>2017-02-14 14:37:12 +0100
commit07e3d60146de6c5906382e378cdcb3d6a6989cd0 (patch)
tree91b336dc01c4c7631a405132b935c2dd803d98e5 /output/http
parent543eea285200c8955f42c5eb202a222105259587 (diff)
Change Output interface to return an error
Diffstat (limited to 'output/http')
-rw-r--r--output/http/http.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/output/http/http.go b/output/http/http.go
index 3ea603c..158f091 100644
--- a/output/http/http.go
+++ b/output/http/http.go
@@ -22,9 +22,11 @@ func New(kv map[string]string) output.Output {
return &HttpOutput{url: url}
}
-func (h *HttpOutput) Output(w *work.Work) {
+func (h *HttpOutput) Output(w *work.Work) error {
_, err := http.Post(h.url, "application/json", bytes.NewReader(w.Data))
if err != nil {
w.Err = err
}
+
+ return err
}