The `readerr != nil` check is redundant here, if `readerr == io.EOF` it is necessarily not nil.