Skip to content

io.SeekStart #1029

@fatelei

Description

@fatelei
type nopReadCloser struct {
	r *bytes.Reader
}

func (r *nopReadCloser) Read(p []byte) (int, error) {
	n, err := r.r.Read(p)
	if err == io.EOF {
		r.r.Seek(0, io.SeekStart)
	}
	return n, err
}

why this function call r.r.Seek(0, io.SeekStart), this. may call loop infinite

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions