Skip to content

Commit

Permalink
misc: remove hyphens from UUID before truncating it
Browse files Browse the repository at this point in the history
Remove hyphens from UUID before truncating it in RandomID()

Longohrn 8551

Signed-off-by: Derek Su <[email protected]>
  • Loading branch information
derekbit committed May 13, 2024
1 parent e68a6cd commit e34875b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion utils/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"path/filepath"
"reflect"
"runtime"
"strings"

"github.com/google/uuid"
"github.com/pkg/errors"
Expand Down Expand Up @@ -67,7 +68,7 @@ func RandomID(randomIDLenth int) string {
randomIDLenth = types.RandomIDDefaultLength
}

uuid := UUID()
uuid := strings.Replace(UUID(), "-", "", -1)

if len(uuid) > randomIDLenth {
uuid = uuid[:randomIDLenth]
Expand Down

0 comments on commit e34875b

Please sign in to comment.