diff --git a/Gopkg.lock b/Gopkg.lock index 8fd113a9..dc4a3818 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -22,14 +22,6 @@ revision = "ab2d9a74b97eda058004c8deef80ac624432f408" version = "v1.0.0" -[[projects]] - digest = "1:141cc9fc6279592458b304038bd16a05ef477d125c6dad281216345a11746fd7" - name = "github.com/gofrs/uuid" - packages = ["."] - pruneopts = "" - revision = "6b08a5c5172ba18946672b49749cde22873dd7c2" - version = "v3.2.0" - [[projects]] digest = "1:a25a2c5ae694b01713fb6cd03c3b1ac1ccc1902b9f0a922680a88ec254f968e1" name = "github.com/google/uuid" @@ -202,7 +194,6 @@ "code.cloudfoundry.org/lager", "code.cloudfoundry.org/lager/lagertest", "github.com/drewolson/testflight", - "github.com/gofrs/uuid", "github.com/gorilla/mux", "github.com/onsi/ginkgo", "github.com/onsi/ginkgo/extensions/table", diff --git a/middlewares/correlation_id_header.go b/middlewares/correlation_id_header.go index 4094732e..c90ec1ce 100644 --- a/middlewares/correlation_id_header.go +++ b/middlewares/correlation_id_header.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "github.com/gofrs/uuid" + "github.com/pborman/uuid" ) const CorrelationIDKey = "correlation-id" @@ -26,19 +26,10 @@ func AddCorrelationIDToContext(next http.Handler) http.Handler { } if !found { - correlationID = generateCorrelationID() + correlationID = uuid.New() } newCtx := context.WithValue(req.Context(), CorrelationIDKey, correlationID) next.ServeHTTP(w, req.WithContext(newCtx)) }) } - -func generateCorrelationID() string { - uuids, err := uuid.NewV4() - if err != nil { - return "" - } - - return uuids.String() -}