And when there’s no more data left to read, it’ll return an io.EOF error, which basically means you’ve hit the end of the data stream. // Make a buffer to store the data for { // Read from file into buffer n , err := f . It blocks the read until there’s data to read, which makes it a simple way to synchronize between a reader and a writer.