From 4263e7739a51398397df24f67d2999c53d7feb36 Mon Sep 17 00:00:00 2001 From: Pavel Gradoboev Date: Mon, 9 Dec 2024 10:22:58 +0300 Subject: [PATCH 1/2] fix: delay after the call eliminates the possibility of creating an enmime.Builder() with the same random seed --- randoption_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/randoption_test.go b/randoption_test.go index 6144a38..bee1946 100644 --- a/randoption_test.go +++ b/randoption_test.go @@ -77,6 +77,7 @@ func buildEmail(t *testing.T, mode ReproducibilityMode) string { b = enmime.Builder() case TimestampSource: b = enmime.Builder().RandSeed(time.Now().UTC().UnixNano()) + time.Sleep(1) default: panic(fmt.Errorf("illegal mode: %d", mode)) } From 47e243aeccc02985386c5f3e729fb8d50fe87abd Mon Sep 17 00:00:00 2001 From: Pavel Gradoboev Date: Mon, 9 Dec 2024 11:05:36 +0300 Subject: [PATCH 2/2] fix: staticcheck SA1004 --- randoption_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/randoption_test.go b/randoption_test.go index bee1946..2e0e151 100644 --- a/randoption_test.go +++ b/randoption_test.go @@ -77,7 +77,7 @@ func buildEmail(t *testing.T, mode ReproducibilityMode) string { b = enmime.Builder() case TimestampSource: b = enmime.Builder().RandSeed(time.Now().UTC().UnixNano()) - time.Sleep(1) + time.Sleep(time.Microsecond) default: panic(fmt.Errorf("illegal mode: %d", mode)) }