From 36b86083a1aa19878caa0cc52be6386dc13b7640 Mon Sep 17 00:00:00 2001 From: stephenmcconkey Date: Thu, 7 Jul 2022 13:50:50 +0100 Subject: [PATCH] Change 'number' to 'int' input on number variations --- evaluation/evaluator.go | 4 ++-- evaluation/evaluator_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/evaluation/evaluator.go b/evaluation/evaluator.go index d1f53819..a705ad7c 100644 --- a/evaluation/evaluator.go +++ b/evaluation/evaluator.go @@ -386,8 +386,8 @@ func (e Evaluator) IntVariation(identifier string, target *Target, defaultValue // NumberVariation returns number evaluation for target func (e Evaluator) NumberVariation(identifier string, target *Target, defaultValue float64) float64 { - - variation, err := e.evaluate(identifier, target, "number") + //all numbers are stored as ints in the database + variation, err := e.evaluate(identifier, target, "int") if err != nil { e.logger.Errorf("Error while evaluating number flag '%s', err: %v", identifier, err) return defaultValue diff --git a/evaluation/evaluator_test.go b/evaluation/evaluator_test.go index ce20d945..f41aa192 100644 --- a/evaluation/evaluator_test.go +++ b/evaluation/evaluator_test.go @@ -136,7 +136,7 @@ var ( Variation: &heavyWeight, }, Variations: numberVariations, - Kind: "number", + Kind: "int", }, org: { Feature: org, @@ -173,7 +173,7 @@ var ( Value: invalidNumberValue, }, }, - Kind: "number", + Kind: "int", }, invalidJSON: { Feature: invalidJSON,