Skip to content

Commit

Permalink
Ent: fixed lint issue on 'main'
Browse files Browse the repository at this point in the history
Signed-off-by: mrizzi <mrizzi@redhat.com>
  • Loading branch information
mrizzi committed Dec 22, 2023
1 parent 7a05b7e commit ade42e5
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions pkg/assembler/backends/ent/backend/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,26 +65,3 @@ func fromPtrSlice[T any](slice []*T) []T {
}
return ptrs
}

func chunk[T any](collection []T, size int) [][]T {
if size <= 0 {
panic("Second parameter must be greater than 0")
}

chunksNum := len(collection) / size
if len(collection)%size != 0 {
chunksNum += 1
}

result := make([][]T, 0, chunksNum)

for i := 0; i < chunksNum; i++ {
last := (i + 1) * size
if last > len(collection) {
last = len(collection)
}
result = append(result, collection[i*size:last])
}

return result
}

0 comments on commit ade42e5

Please sign in to comment.