One chunk is a step; the whole file is a walk. Today you read chunks one after another from the signature all the way to the terminating IEND, turning a PNG into a list of chunks.
Read every chunk of a PNG in order, stopping after the IEND chunk, and return them as a list.
The signature gets you to byte 8; from there the file is a loop. Read a chunk, append it, advance by the byte span the previous lesson returned, and repeat. The loop has a definite end: the IEND chunk is always the last one, so once you have appended an IEND you stop, even if the file has stray bytes after it. This is the backbone every later stage stands on - IHDR to learn the image shape, IDAT for the pixel data, PLTE for a palette.
Two guards make this robust. Refuse to start unless the signature is present, so garbage never gets parsed as chunks. And treat IEND as the terminator rather than running until the buffer is exhausted, because well-formed files can carry trailing whitespace or padding. With this loop you have the container fully in hand; everything from here reads inside these chunks.
func Chunks(b []byte) ([]Chunk, error) {// 1. require HasSignature(b); else error// 2. from offset 8, readChunk, append, advance by its span// 3. stop once a chunk of type "IEND" was appended}