Switch to google/uuid from satori/go.uuid (#2852)

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
Sanket Sudake
2023-10-17 12:19:17 +05:30
committed by GitHub
parent 7b21fbc199
commit c6329ee3db
20 changed files with 58 additions and 124 deletions
+2 -6
View File
@@ -3,9 +3,9 @@ package storagesvc
import (
"os"
"github.com/fission/fission/pkg/utils/uuid"
"github.com/graymeta/stow"
_ "github.com/graymeta/stow/local"
uuid "github.com/satori/go.uuid"
)
type localStorage struct {
@@ -35,11 +35,7 @@ func (ls localStorage) getStorageType() StorageType {
func (ls localStorage) getUploadFileName() (string, error) {
// This is not the item ID (that's returned by Put)
// should we just use handler.Filename? what are the constraints here?
id, err := uuid.NewV4()
if err != nil {
return "", err
}
return id.String(), err
return uuid.NewString(), nil
}
func (ls localStorage) getSubDir() string {
+4 -6
View File
@@ -6,7 +6,8 @@ import (
"github.com/graymeta/stow"
"github.com/graymeta/stow/s3"
uuid "github.com/satori/go.uuid"
"github.com/fission/fission/pkg/utils/uuid"
)
type (
@@ -54,11 +55,8 @@ func (ss s3Storage) getSubDir() string {
}
func (ss s3Storage) getUploadFileName() (string, error) {
id, err := uuid.NewV4()
if err != nil {
return "", err
}
return path.Join(ss.subDir, id.String()), nil
id := uuid.NewString()
return path.Join(ss.subDir, id), nil
}
func (ss s3Storage) dial() (stow.Location, error) {