From 4534dffb865eb1a50bfbc291a5c3798183081caf Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Sun, 26 May 2024 20:33:37 +0200 Subject: feat: Add actual git listing implementation --- pkg/u/util.go | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 pkg/u/util.go (limited to 'pkg/u/util.go') diff --git a/pkg/u/util.go b/pkg/u/util.go deleted file mode 100644 index 34eafd1..0000000 --- a/pkg/u/util.go +++ /dev/null @@ -1,17 +0,0 @@ -package u - -func First[T any](v []T) (T, bool) { - if len(v) == 0 { - var zero T - return zero, false - } - return v[0], true -} - -func ChunkBy[T any](items []T, chunkSize int) [][]T { - var chunks = make([][]T, 0, (len(items)/chunkSize)+1) - for chunkSize < len(items) { - items, chunks = items[chunkSize:], append(chunks, items[0:chunkSize:chunkSize]) - } - return append(chunks, items) -} -- cgit v1.2.3