func (l *Location) NewLocation(relativePath string) (vfs.Location, error) {
	if l == nil {
		return nil, errors.New("non-nil gs.Location pointer is required")
	}
	newLocation := &Location{}
	*newLocation = *l
	err := newLocation.ChangeDir(relativePath)
	if err != nil {
		return nil, err
	}
	return newLocation, nil
}
NewLocation creates a new location instance relative to the current location's path.
package gs
import (
	"errors"
	"path"
	"regexp"
	"strings"
	"cloud.google.com/go/storage"
	"google.golang.org/api/iterator"
	"github.com/c2fo/vfs/v6"
	"github.com/c2fo/vfs/v6/utils"
)
type Location struct {
	fileSystem   *FileSystem
	prefix       string
	bucket       string
	bucketHandle BucketHandleWrapper
}
func (l *Location) String() string {
	return l.URI()
}
func (l *Location) List() ([]string, error) {
	return l.ListByPrefix("")
}
func (l *Location) ListByPrefix(filenamePrefix string) ([]string, error) {
	prefix := utils.RemoveLeadingSlash(utils.EnsureTrailingSlash(path.Join(l.prefix, filenamePrefix)))
	d := path.Dir(prefix)
	q := &storage.Query{
		Delimiter: "/",
		Prefix:    prefix,
		Versions:  false,
	}
	handle, err := l.getBucketHandle()
	if err != nil {
		return nil, err
	}
	var fileNames []string
	it := handle.WrappedObjects(l.fileSystem.ctx, q)
	for {
		objAttrs, err := it.Next()
		if err != nil {
			if err == iterator.Done {
				break
			}
			return nil, err
		}
		if objAttrs.Prefix == "" && objAttrs.Name != d && !strings.HasSuffix(objAttrs.Name, "/") {
			fn := strings.TrimPrefix(objAttrs.Name, utils.EnsureTrailingSlash(d))
			fileNames = append(fileNames, fn)
		}
	}
	return fileNames, nil
}
func (l *Location) ListByRegex(regex *regexp.Regexp) ([]string, error) {
	keys, err := l.List()
	if err != nil {
		return []string{}, err
	}
	var filteredKeys []string
	for _, key := range keys {
		if regex.MatchString(key) {
			filteredKeys = append(filteredKeys, key)
		}
	}
	return filteredKeys, nil
}
func (l *Location) Volume() string {
	return l.bucket
}
func (l *Location) Path() string {
	return utils.EnsureLeadingSlash(utils.EnsureTrailingSlash(l.prefix))
}
func (l *Location) Exists() (bool, error) {
	_, err := l.getBucketAttrs()
	if err != nil {
		if err == storage.ErrBucketNotExist {
			return false, nil
		}
		return false, err
	}
	return true, nil
}