From 700d898a7483f075317c0758155a03ed7943b4c3 Mon Sep 17 00:00:00 2001 From: Vladimir Garvardt Date: Mon, 28 Jan 2019 12:23:55 +0100 Subject: [PATCH] Replaced satori uuid with gofrs --- Gopkg.lock | 18 +++++++++--------- Gopkg.toml | 4 ++++ pkg/middleware/request_id.go | 4 ++-- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 641381540..3849974e3 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -173,6 +173,14 @@ revision = "83fb42932f6145ce52df09860384a4653d2d332a" version = "v6.12.0" +[[projects]] + digest = "1:141cc9fc6279592458b304038bd16a05ef477d125c6dad281216345a11746fd7" + name = "github.com/gofrs/uuid" + packages = ["."] + pruneopts = "" + revision = "6b08a5c5172ba18946672b49749cde22873dd7c2" + version = "v3.2.0" + [[projects]] digest = "1:3dd078fda7500c341bc26cfbc6c6a34614f295a2457149fc1045cab767cbcf18" name = "github.com/golang/protobuf" @@ -388,14 +396,6 @@ revision = "ca016a06a5753f8ba03029c0aa5e54afb1bf713f" version = "v1.4.0" -[[projects]] - digest = "1:7f569d906bdd20d906b606415b7d794f798f91a62fcfb6a4daa6d50690fb7a3f" - name = "github.com/satori/go.uuid" - packages = ["."] - pruneopts = "" - revision = "f58768cc1a7a7e77a3bd49e98cdd21419399b6a3" - version = "v1.2.0" - [[projects]] digest = "1:8cf46b6c18a91068d446e26b67512cf16f1540b45d90b28b9533706a127f0ca6" name = "github.com/sirupsen/logrus" @@ -670,6 +670,7 @@ "github.com/go-chi/chi", "github.com/go-chi/chi/middleware", "github.com/go-redis/redis", + "github.com/gofrs/uuid", "github.com/google/go-github/github", "github.com/hellofresh/health-go", "github.com/hellofresh/logging-go", @@ -684,7 +685,6 @@ "github.com/pkg/errors", "github.com/rafaeljesus/retry-go", "github.com/rs/cors", - "github.com/satori/go.uuid", "github.com/sirupsen/logrus", "github.com/spf13/cobra", "github.com/spf13/viper", diff --git a/Gopkg.toml b/Gopkg.toml index 5ead4f5ee..e780ad7f5 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -123,3 +123,7 @@ [[constraint]] name = "github.com/globalsign/mgo" version = "r2018.04.23" + +[[constraint]] + name = "github.com/gofrs/uuid" + version = "3.2.0" diff --git a/pkg/middleware/request_id.go b/pkg/middleware/request_id.go index 22178186b..d95a6b5c5 100644 --- a/pkg/middleware/request_id.go +++ b/pkg/middleware/request_id.go @@ -3,8 +3,8 @@ package middleware import ( "net/http" + "github.com/gofrs/uuid" "github.com/hellofresh/janus/pkg/observability" - "github.com/satori/go.uuid" ) type reqIDKeyType int @@ -19,7 +19,7 @@ func RequestID(handler http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { requestID := r.Header.Get(requestIDHeader) if requestID == "" { - requestID = uuid.NewV4().String() + requestID = uuid.Must(uuid.NewV4()).String() } r.Header.Set(requestIDHeader, requestID)