:arrow_up:升级uuid依赖
This commit is contained in:
8
file.go
8
file.go
@@ -3,7 +3,7 @@ package go_aliyun_oss
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
uuid "github.com/satori/go.uuid"
|
||||
"github.com/google/uuid"
|
||||
"io/ioutil"
|
||||
"mime/multipart"
|
||||
"os"
|
||||
@@ -84,9 +84,9 @@ func (ossFile *OssFile) FileTypeTransForm() (*OssFile, error) {
|
||||
|
||||
//判断是否指定了文件的类型 如果没有指定默认为png格式
|
||||
if ossFile.FileType == "" || len(ossFile.FileType) <= 0 {
|
||||
ossFile.FileOldName = uuid.NewV4().String() + ".png"
|
||||
ossFile.FileOldName = uuid.NewString() + ".png"
|
||||
} else {
|
||||
ossFile.FileOldName = uuid.NewV4().String() + ossFile.FileType
|
||||
ossFile.FileOldName = uuid.NewString() + ossFile.FileType
|
||||
}
|
||||
|
||||
break
|
||||
@@ -116,7 +116,7 @@ func (ossFile *OssFile) GetFileType() *OssFile {
|
||||
}
|
||||
|
||||
//generate only file name
|
||||
ossFile.FileNewName = uuid.NewV5(uuid.NewV4(), ossFile.FileOldName).String() + ossFile.FileType
|
||||
ossFile.FileNewName = uuid.NewString() + ossFile.FileType
|
||||
|
||||
return ossFile
|
||||
}
|
||||
|
||||
2
go.mod
2
go.mod
@@ -5,7 +5,7 @@ go 1.15
|
||||
require (
|
||||
github.com/aliyun/aliyun-oss-go-sdk v2.2.5+incompatible
|
||||
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f // indirect
|
||||
github.com/satori/go.uuid v1.2.0
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
|
||||
)
|
||||
|
||||
2
go.sum
2
go.sum
@@ -4,6 +4,8 @@ github.com/aliyun/aliyun-oss-go-sdk v2.2.5+incompatible h1:QoRMR0TCctLDqBCMyOu1e
|
||||
github.com/aliyun/aliyun-oss-go-sdk v2.2.5+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8=
|
||||
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f h1:ZNv7On9kyUzm7fvRZumSyy/IUiSC7AzL0I1jKKtwooA=
|
||||
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
|
||||
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
|
||||
Reference in New Issue
Block a user