From 4c8dc8d54f4485ac29e577c975f43a43c193f4b3 Mon Sep 17 00:00:00 2001 From: Maxton Huff Date: Mon, 29 Mar 2021 16:24:56 -0500 Subject: [PATCH] address variable declaration warning --- executor.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/executor.go b/executor.go index a5a824559..65fe1b0c7 100644 --- a/executor.go +++ b/executor.go @@ -1308,11 +1308,11 @@ func (e *executor) executePercentile(ctx context.Context, qcx *Qcx, index string if nthArg == nil { return ValCount{}, errors.New("Percentile(): nth required") } - switch nthArg.(type) { + switch nthArg := nthArg.(type) { case pql.Decimal: - nthFloat = nthArg.(pql.Decimal).Float64() + nthFloat = nthArg.Float64() case int64: - nthFloat = float64(nthArg.(int64)) + nthFloat = float64(nthArg) default: return ValCount{}, errors.Errorf("Percentile(): invalid nth='%v' of type (%[1]T), should be int64 or pql.Decimal", c.Args["nth"]) }