Change the order of Apply to be more Unixy

Typically the destination is on the left and the src is on the right.
This commit is contained in:
Noah Campbell
2013-10-01 14:42:08 -07:00
parent 94a3184ad0
commit 80009b427f
7 changed files with 13 additions and 10 deletions

View File

@@ -13,11 +13,11 @@ func NewChain(trs ...Transformer) Transformer {
return &chain{transformers: trs}
}
func (c *chain) Apply(r io.Reader, w io.Writer) (err error) {
func (c *chain) Apply(w io.Writer, r io.Reader) (err error) {
in := r
for _, tr := range c.transformers {
out := new(bytes.Buffer)
err = tr.Apply(in, out)
err = tr.Apply(out, in)
if err != nil {
return
}