func ValidateRelativeFilePath(name string) error {
	if name == "" || strings.HasPrefix(name, "/") || strings.HasSuffix(name, "/") {
		return errors.New(ErrBadRelFilePath)
	}
	return nil
}
ValidateRelativeFilePath ensures that a file path has neither leading nor trailing slashes
package utils
import (
	"errors"
	"fmt"
	"io"
	"regexp"
	"strings"
	"time"
	"github.com/c2fo/vfs/v6"
)
const (
	ErrBadAbsFilePath = "absolute file path is invalid - must include leading slash and may not include trailing slash"
	ErrBadRelFilePath = "relative file path is invalid - may not include leading or trailing slashes"
	ErrBadAbsLocationPath = "absolute location path is invalid - must include leading and trailing slashes"
	ErrBadRelLocationPath = "relative location path is invalid - may not include leading slash but must include trailing slash"
	TouchCopyMinBufferSize = 262144
)
var hasTrailingSlash = regexp.MustCompile("/$")
var hasLeadingSlash = regexp.MustCompile("^/")
func RemoveTrailingSlash(path string) string {
	return strings.TrimRight(path, "/")
}
func RemoveLeadingSlash(path string) string {
	return strings.TrimLeft(path, "/")
}
func ValidateAbsoluteFilePath(name string) error {
	if !strings.HasPrefix(name, "/") || strings.HasSuffix(name, "/") {
		return errors.New(ErrBadAbsFilePath)
	}
	return nil
}