You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: io.go
    path of file: ./repos/trivy/pkg/x/io
    
    the code of the file until where you have to start completion: package io

import (
	"bytes"
	"io"

	"golang.org/x/xerrors"
)

type ReadSeekerAt interface {
	io.ReadSeeker
	io.ReaderAt
}

type ReadSeekCloserAt interface {
	io.ReadSeekCloser
	io.ReaderAt
}

func NewReadSeekerAt(r io.Reader) (ReadSeekerAt, error
    
func NewReadSeekerAt(r io.Reader) (ReadSeekerAt, error) {
	if rr, ok := r.(ReadSeekerAt); ok {
		return rr, nil
	}

	buff := bytes.NewBuffer([]byte{})
	if _, err := io.Copy(buff, r); err != nil {
		return nil, xerrors.Errorf("copy error: %w", err)
	}

	return bytes.NewReader(buff.Bytes()), nil
}