summaryrefslogtreecommitdiff
path: root/filter/str
diff options
context:
space:
mode:
Diffstat (limited to 'filter/str')
-rw-r--r--filter/str/string.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/filter/str/string.go b/filter/str/string.go
index c3e2213..37f49f6 100644
--- a/filter/str/string.go
+++ b/filter/str/string.go
@@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"io"
+ "os"
"strings"
"github.com/Shugyousha/stasher/filter"
@@ -40,11 +41,11 @@ func (f *StringFilter) Filter(w *work.Work) *work.Work {
err := dec.Decode(&jm)
if err == io.EOF {
- fmt.Printf("EOF jm: %v\n", jm)
+ fmt.Fprintf(os.Stderr, "EOF jm: %v\n", jm)
return w
}
if err != nil {
- fmt.Printf("Error when decoding JSON: %q\n", err)
+ fmt.Fprintf(os.Stderr, "Error when decoding JSON: %q\n", err)
w.Err = err
return w
}
@@ -62,7 +63,7 @@ func (f *StringFilter) Filter(w *work.Work) *work.Work {
if changed {
bs, err := json.Marshal(jm)
if err != nil {
- fmt.Printf("Error when marshalling JSON: %q\n", err)
+ fmt.Fprintf(os.Stderr, "Error when marshaling JSON: %q\n", err)
w.Err = err
} else {
w.Data = bs