From 4ab91520bd031828d37bc3b2e2c53dcd2abca06d Mon Sep 17 00:00:00 2001 From: Skyxim Date: Sat, 7 May 2022 12:35:14 +0800 Subject: [PATCH] refactor: reuse uuid namespace --- common/utils/uuid.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/utils/uuid.go b/common/utils/uuid.go index 9ece3093..72f7ce75 100644 --- a/common/utils/uuid.go +++ b/common/utils/uuid.go @@ -4,11 +4,12 @@ import ( "github.com/gofrs/uuid" ) +var uuidNamespace, _ = uuid.FromString("00000000-0000-0000-0000-000000000000") + // UUIDMap https://github.com/XTLS/Xray-core/issues/158#issue-783294090 func UUIDMap(str string) (uuid.UUID, error) { u, err := uuid.FromString(str) if err != nil { - uuidNamespace, err := uuid.FromString("00000000-0000-0000-0000-000000000000") if err != nil { return uuid.UUID{}, err }