From 275c2734c9baa39359942ab4a8bd84907d73219d Mon Sep 17 00:00:00 2001 From: Quang Le Date: Thu, 18 Jul 2019 10:39:11 +0700 Subject: [PATCH] Fix error when number of runs reaches the run threshold --- enumer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/enumer.go b/enumer.go index 6c3d6fd..505827d 100644 --- a/enumer.go +++ b/enumer.go @@ -79,7 +79,7 @@ func (g *Generator) buildBasicExtras(runs [][]Value, typeName string, runsThresh // Print the basic extra methods g.Printf(stringNameToValueMethod, typeName) g.Printf(stringValuesMethod, typeName) - if len(runs) < runsThreshold { + if len(runs) <= runsThreshold { g.Printf(stringBelongsMethodLoop, typeName) } else { // There is a map of values, the code is simpler then g.Printf(stringBelongsMethodSet, typeName)