From ae76e2e55e34c038f1a873dad748de3fadd1974e Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan <aadhavan@twomorecents.org> Date: Mon, 27 Jan 2025 16:00:26 -0500 Subject: [PATCH] Added a function to generate a slice of all values (inclusive) in a range --- misc.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/misc.go b/misc.go index 19a2fc4..9e0f73a 100644 --- a/misc.go +++ b/misc.go @@ -133,6 +133,13 @@ func genRange[T character](start, end T) []T { return toRet } +// Generate numbers in a range - start to end (both inclusive) +func genRangeInclusive[T character](start, end T) []T { + toRet := genRange(start, end) + toRet = append(toRet, end) + return toRet +} + // Returns a rune-slice containing all possible cases of the given rune. // At the moment, this includes: // 1. Upper case