From 459062d4ad69be760f258ecb42e37531939a256d Mon Sep 17 00:00:00 2001 From: Trim21 Date: Thu, 15 Sep 2022 16:28:09 +0800 Subject: [PATCH] `Slice` can take any slice (#207) --- slice.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slice.go b/slice.go index 261d42c2..4d1e9bf3 100644 --- a/slice.go +++ b/slice.go @@ -408,7 +408,7 @@ func Subset[T any](collection []T, offset int, length uint) []T { } // Slice returns a copy of a slice from `start` up to, but not including `end`. Like `slice[start:end]`, but does not panic on overflow. -func Slice[T comparable](collection []T, start int, end int) []T { +func Slice[T any](collection []T, start int, end int) []T { size := len(collection) if start >= end {