This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
backend/pkg/filestorage/filestorageutil/generate_filename.go

15 lines
210 B
Go
Raw Normal View History

2021-05-02 06:36:10 +00:00
package filestorageutil
import (
"strings"
"github.com/google/uuid"
)
func GenerateFilename(ext string) string {
if !strings.HasPrefix(ext, ".") {
ext = "." + ext
}
return uuid.New().String() + ext
}