File tree 4 files changed +3
-12
lines changed
4 files changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -17,10 +17,6 @@ import (
17
17
"heckel.io/ntfy/v2/util"
18
18
)
19
19
20
- func init () {
21
- rand .Seed (time .Now ().UnixMilli ())
22
- }
23
-
24
20
func TestCLI_Serve_Unix_Curl (t * testing.T ) {
25
21
sockFile := filepath .Join (t .TempDir (), "ntfy.sock" )
26
22
configFile := newEmptyFile (t ) // Avoid issues with existing server.yml file on system
Original file line number Diff line number Diff line change @@ -3,13 +3,13 @@ package server
3
3
import (
4
4
"bufio"
5
5
"context"
6
+ "crypto/rand"
6
7
"encoding/base64"
7
8
"encoding/json"
8
9
"fmt"
9
10
"golang.org/x/crypto/bcrypt"
10
11
"heckel.io/ntfy/v2/user"
11
12
"io"
12
- "math/rand"
13
13
"net/http"
14
14
"net/http/httptest"
15
15
"net/netip"
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ func TestTopic_Subscribe_DuplicateID(t *testing.T) {
69
69
t .Parallel ()
70
70
to := newTopic ("mytopic" )
71
71
72
- // Fix random seed to force same number generation
72
+ //lint:ignore SA1019 Fix random seed to force same number generation
73
73
rand .Seed (1 )
74
74
a := rand .Int ()
75
75
to .subscribers [a ] = & topicSubscriber {
@@ -82,7 +82,7 @@ func TestTopic_Subscribe_DuplicateID(t *testing.T) {
82
82
return nil
83
83
}
84
84
85
- // Force rand.Int to generate the same id once more
85
+ //lint:ignore SA1019 Force rand.Int to generate the same id once more
86
86
rand .Seed (1 )
87
87
id := to .Subscribe (subFn , "b" , func () {})
88
88
res := to .subscribers [id ]
Original file line number Diff line number Diff line change @@ -7,13 +7,8 @@ import (
7
7
"net/http"
8
8
"path/filepath"
9
9
"testing"
10
- "time"
11
10
)
12
11
13
- func init () {
14
- rand .Seed (time .Now ().UnixMilli ())
15
- }
16
-
17
12
// StartServer starts a server.Server with a random port and waits for the server to be up
18
13
func StartServer (t * testing.T ) (* server.Server , int ) {
19
14
return StartServerWithConfig (t , server .NewConfig ())
You can’t perform that action at this time.
0 commit comments