From 12740f05dbddeb42e21b1714cc2cbe12833bcd39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=AC=E5=A5=87=E8=BE=89?= Date: Wed, 14 Dec 2022 15:29:19 +0800 Subject: [PATCH] change uuid to google/uuid --- go.mod | 4 ++-- go.sum | 4 ++-- producer/producer.go | 7 +++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index b35c4dc1..1a11b28b 100644 --- a/go.mod +++ b/go.mod @@ -7,10 +7,10 @@ require ( github.com/emirpasic/gods v1.12.0 github.com/go-redis/redis/v8 v8.11.5 github.com/golang/mock v1.3.1 + github.com/google/uuid v1.3.0 github.com/json-iterator/go v1.1.12 github.com/patrickmn/go-cache v2.1.0+incompatible github.com/pkg/errors v0.8.1 - github.com/satori/go.uuid v1.2.0 github.com/sirupsen/logrus v1.4.0 github.com/smartystreets/goconvey v1.6.4 github.com/stretchr/testify v1.5.1 @@ -20,4 +20,4 @@ require ( gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 stathat.com/c/consistent v1.0.0 -) \ No newline at end of file +) diff --git a/go.sum b/go.sum index 1ec2f171..7c946367 100644 --- a/go.sum +++ b/go.sum @@ -37,6 +37,8 @@ github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -77,8 +79,6 @@ github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sirupsen/logrus v1.4.0 h1:yKenngtzGh+cUSSh6GWbxW2abRqhYUSR/t/6+2QqNvE= github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= diff --git a/producer/producer.go b/producer/producer.go index fa2a8328..a90f0acc 100644 --- a/producer/producer.go +++ b/producer/producer.go @@ -26,15 +26,14 @@ import ( "sync/atomic" "time" - "github.com/pkg/errors" - uuid "github.com/satori/go.uuid" - errors2 "github.com/apache/rocketmq-client-go/v2/errors" "github.com/apache/rocketmq-client-go/v2/internal" "github.com/apache/rocketmq-client-go/v2/internal/remote" "github.com/apache/rocketmq-client-go/v2/internal/utils" "github.com/apache/rocketmq-client-go/v2/primitive" "github.com/apache/rocketmq-client-go/v2/rlog" + "github.com/google/uuid" + "github.com/pkg/errors" ) type defaultProducer struct { @@ -157,7 +156,7 @@ func MarshalMessageBatch(msgs ...*primitive.Message) []byte { } func (p *defaultProducer) prepareSendRequest(msg *primitive.Message, ttl time.Duration) (string, error) { - correlationId := uuid.NewV4().String() + correlationId := uuid.New().String() requestClientId := p.client.ClientID() msg.WithProperty(primitive.PropertyCorrelationID, correlationId) msg.WithProperty(primitive.PropertyMessageReplyToClient, requestClientId)