From 2cc0f9607872b8bd4fc6be2656a7b7a769b538b2 Mon Sep 17 00:00:00 2001 From: Adrien Hopkins Date: Tue, 7 Nov 2023 07:50:23 -0500 Subject: Reduce golang requirement to go1.18 go1.21, the previous requirement, was released a few months ago, so not all systems have adopted it. go1.18 is old enough that most systems should support it, but it introduces generics, which my testing code is highly dependent on, so I can't easily go any earlier. --- factor_info.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'factor_info.go') diff --git a/factor_info.go b/factor_info.go index a6710e7..f3193b5 100644 --- a/factor_info.go +++ b/factor_info.go @@ -5,7 +5,7 @@ import ( "fmt" "io" "math" - "slices" + "sort" ) // FactorInfo contains all of the information this program @@ -64,7 +64,9 @@ func getFactorInfo(a args) *factorInfo { radix := a.Radix r_factors := factors.Factors(radix) - slices.Sort(r_factors) + sort.Slice(r_factors, func(i, j int) bool { + return r_factors[i] < r_factors[j] + }) var totativeDigits []uint32 = nil if a.TotativeDigits && radix < maxExtended { -- cgit v1.2.3