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: recorder.go
    path of file: ./repos/requests
    
    the code of the file until where you have to start completion: package requests

import (
	"bufio"
	"bytes"
	"crypto/md5"
	"encoding/base64"
	"errors"
	"fmt"
	"io/fs"
	"net/http"
	"net/http/httputil"
	"os"
	"path/filepath"
)

// Record returns an http.RoundTripper that writes out its
// requests and their responses to text files in basepath.
// Requests are named according to a hash of their contents.
// Responses are named according to the request that made them.
func Record(rt http.RoundTripper, basepath string) Transport {
	if rt == nil {
		rt = http.DefaultTransport
	}
	return RoundTripFunc(func(req *http.Request) (res *http.Response, err error) {
		defer func() {
			if err != nil {
				err = fmt.Errorf("problem while recording transport: %w", err)
			}
		}()
		_ = os.MkdirAll(basepath, 0755)
	
    
func ReplayFS(fsys fs.FS) Transport {
	return RoundTripFunc(func(req *http.Request) (res *http.Response, err error) {
		defer func() {
			if err != nil {
				err = fmt.Errorf("problem while replaying transport: %w", err)
			}
		}()
		b, err := httputil.DumpRequest(req, true)
		if err != nil {
			return nil, err
		}
		_, name := buildName(b)
		glob := "*" + name
		matches, err := fs.Glob(fsys, glob)
		if err != nil {
			return nil, err
		}
		if len(matches) == 0 {
			return nil, fmt.Errorf("%w: no replay file matches %q", errNotFound, glob)
		}
		if len(matches) > 1 {
			return nil, fmt.Errorf("ambiguous response: multiple replay files match %q", glob)
		}
		b, err = fs.ReadFile(fsys, matches[0])
		if err != nil {
			return nil, err
		}
		r := bufio.NewReader(bytes.NewReader(b))
		return http.ReadResponse(r, req)
	})
}