func split(buf []*pixel, count int) [][]*pixel {
	var chunk []*pixel
	chunks := make([][]*pixel, 0, len(buf)/count+1)
	for len(buf) >= count {
		chunk, buf = buf[:count], buf[count:]
		chunks = append(chunks, chunk)
	}
	if len(buf) > 0 {
		chunks = append(chunks, buf)
	}
	return chunks
}
split is a util function which split an array into an array of array with count elements each (the last one may hold less...)
package main
import (
	"math"
	"math/rand"
	"sync"
	"fmt"
	"time"
)
type Pixels []uint32
type Scene struct {
	width, height int
	raysPerPixel  []int
	camera        Camera
	world         Hitable
}
type pixel struct {
	x, y, k      int
	color        Color
	raysPerPixel int
}