From 30f42c07f2e2b27b4b5944e06c04a4e61929e14d Mon Sep 17 00:00:00 2001 From: Radu Ioan Fericean Date: Mon, 25 Apr 2016 22:26:20 +0300 Subject: [PATCH] renamed *periodic to *incremental --- utils/value_formula.go | 6 +++--- utils/value_formula_test.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/utils/value_formula.go b/utils/value_formula.go index 2a554f39e..1ac113aa1 100644 --- a/utils/value_formula.go +++ b/utils/value_formula.go @@ -30,14 +30,14 @@ func ParseBalanceFilterValue(val string) (*ValueFormula, error) { type valueFormula func(map[string]interface{}) float64 const ( - PERIODIC = "*periodic" + INCREMENTAL = "*incremental" ) var ValueFormulas = map[string]valueFormula{ - PERIODIC: periodicFormula, + INCREMENTAL: incrementalFormula, } -func periodicFormula(params map[string]interface{}) float64 { +func incrementalFormula(params map[string]interface{}) float64 { // check parameters unitsInterface, unitsFound := params["Units"] intervalInterface, intervalFound := params["Interval"] diff --git a/utils/value_formula_test.go b/utils/value_formula_test.go index bb140a15d..1aab18106 100644 --- a/utils/value_formula_test.go +++ b/utils/value_formula_test.go @@ -11,7 +11,7 @@ func TestValueFormulaDayWeek(t *testing.T) { if err := json.Unmarshal([]byte(`{"Units":10, "Interval":"week", "Increment":"day"}`), ¶ms); err != nil { t.Error("error unmarshalling params: ", err) } - if x := periodicFormula(params); x != 10/7.0 { + if x := incrementalFormula(params); x != 10/7.0 { t.Error("error caclulating value using formula: ", x) } } @@ -22,7 +22,7 @@ func TestValueFormulaDayMonth(t *testing.T) { t.Error("error unmarshalling params: ", err) } now := time.Now() - if x := periodicFormula(params); x != 10/DaysInMonth(now.Year(), now.Month()) { + if x := incrementalFormula(params); x != 10/DaysInMonth(now.Year(), now.Month()) { t.Error("error caclulating value using formula: ", x) } } @@ -33,7 +33,7 @@ func TestValueFormulaDayYear(t *testing.T) { t.Error("error unmarshalling params: ", err) } now := time.Now() - if x := periodicFormula(params); x != 10/DaysInYear(now.Year()) { + if x := incrementalFormula(params); x != 10/DaysInYear(now.Year()) { t.Error("error caclulating value using formula: ", x) } }