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: file_store.go
    path of file: ./repos/streamdal/apps/server/vendor/github.com/DataDog/go-tuf/client
    
    the code of the file until where you have to start completion: package client

import (
	"bytes"
	"errors"
	"fmt"
	"io"
	"io/fs"
)

// FileRemoteStore provides a RemoteStore interface compatible
// implementation that can be used wher
    
func NewFileRemoteStore(fsys fs.FS, targetDir string) (*FileRemoteStore, error) {
	if fsys == nil {
		return nil, errors.New("nil fs.FS")
	}
	t := targetDir
	if t == "" {
		t = "targets"
	}
	// Make sure directory exists
	d, err := fsys.Open(t)
	if err != nil {
		return nil, fmt.Errorf("failed to open targets directory %s: %w", t, err)
	}
	fi, err := d.Stat()
	if err != nil {
		return nil, fmt.Errorf("failed to stat targets directory %s: %w", t, err)
	}
	if !fi.IsDir() {
		return nil, fmt.Errorf("targets directory not a directory %s", t)
	}

	fsysT, err := fs.Sub(fsys, t)
	if err != nil {
		return nil, fmt.Errorf("failed to open targets directory %s: %w", t, err)
	}
	return &FileRemoteStore{fsys: fsys, targetDir: fsysT}, nil
}