From 2c60218c3dd2da28cb613fd46cd22c05a7f563ad Mon Sep 17 00:00:00 2001 From: "mojo-machine[bot]" <111131124+mojo-machine[bot]@users.noreply.github.com> Date: Tue, 10 Sep 2024 10:18:18 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=84=20Sync=20from=20monorepo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/wearemojo/mojo/commit/489fab8ebb24285b15fa02953cb5c67702fbb113 --- lib/ksuid/id_test.go | 1 + lib/ksuid/node.go | 1 + lib/middleware/request/logger_test.go | 3 +-- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ksuid/id_test.go b/lib/ksuid/id_test.go index 7bf2744..95fbde4 100644 --- a/lib/ksuid/id_test.go +++ b/lib/ksuid/id_test.go @@ -1,3 +1,4 @@ +//nolint:gosec // we're using fixed timestamps for tests package ksuid import ( diff --git a/lib/ksuid/node.go b/lib/ksuid/node.go index a217286..923e2e6 100644 --- a/lib/ksuid/node.go +++ b/lib/ksuid/node.go @@ -55,6 +55,7 @@ func (n *Node) Generate(ctx context.Context, resource string) (id ID) { n.sequenceMu.Lock() + //nolint:gosec // this will be fine for a very, very long time timestamp := uint64(time.Now().UTC().Unix()) if (timestamp - n.timestamp) >= 1 { n.timestamp = timestamp diff --git a/lib/middleware/request/logger_test.go b/lib/middleware/request/logger_test.go index 8856d72..19192ef 100644 --- a/lib/middleware/request/logger_test.go +++ b/lib/middleware/request/logger_test.go @@ -46,8 +46,6 @@ func TestResponseWriter(t *testing.T) { } func TestLogger(t *testing.T) { - ctx := context.Background() - tests := []struct { Name string Status int @@ -60,6 +58,7 @@ func TestLogger(t *testing.T) { for _, test := range tests { t.Run(test.Name, func(t *testing.T) { + ctx := context.Background() is := is.New(t) log := logrus.New().WithField("foo", "bar")