switch from github.com/gofrs/uuid to github.com/google/uuid (#65016)

* switch from github.com/gofrs/uuid to github.com/google/uuid

* add golangci rule to prevent inadvertent reintroduction
This commit is contained in:
Dan Cech
2023-03-21 06:31:29 -04:00
committed by GitHub
parent a7bb87d15d
commit cc5211119b
4 changed files with 4 additions and 5 deletions
+2 -2
View File
@@ -36,7 +36,7 @@ import (
"strings"
"unicode/utf8"
"github.com/gofrs/uuid"
"github.com/google/uuid"
)
var (
@@ -53,7 +53,7 @@ func Slugify(value string) string {
if s == "" {
s = base64.RawURLEncoding.EncodeToString([]byte(value))
if len(s) > 50 || s == "" {
s = uuid.NewV5(uuid.NamespaceOID, value).String()
s = uuid.NewSHA1(uuid.NameSpaceOID, []byte(value)).String()
}
}
return s