diff --git a/acc.go b/acc.go index 2206bc8..4e35b58 100644 --- a/acc.go +++ b/acc.go @@ -16,7 +16,7 @@ type accumulator struct { func (a *accumulator) total(vals []interface{}) (interface{}, error) { if vals == nil || len(vals) == 0 { - return int64(0), nil + return a.acc, nil } switch v := vals[0].(type) { diff --git a/proc.go b/proc.go index 2906dfb..a069457 100644 --- a/proc.go +++ b/proc.go @@ -63,6 +63,8 @@ func multiplication(vals []interface{}) (interface{}, error) { intFn: func(left, right int64) (int64, error) { return left * right, nil }, + acc: 1, + accf: 1.0, } return a.total(vals) }