diff options
| author | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2024-06-17 19:51:37 -0700 |
|---|---|---|
| committer | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2024-06-17 19:51:37 -0700 |
| commit | f8e4cd540b87de3e308ec18a2b040b284a741522 (patch) | |
| tree | 6d8b1ad0bd04cc19ecaf276e271caaef4d0866f4 /hotline/server.go | |
| parent | 45ca5d60383cbe270624c713b916da29af7ba88f (diff) | |
Clean up various linter warnings
Diffstat (limited to 'hotline/server.go')
| -rw-r--r-- | hotline/server.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/hotline/server.go b/hotline/server.go index 448aab1..5245c7b 100644 --- a/hotline/server.go +++ b/hotline/server.go @@ -4,6 +4,7 @@ import ( "bufio" "bytes" "context" + "crypto/rand" "encoding/binary" "errors" "fmt" @@ -15,7 +16,6 @@ import ( "log" "log/slog" "math/big" - "math/rand" "net" "os" "path" @@ -760,7 +760,8 @@ func (s *Server) NewPrivateChat(cc *ClientConn) []byte { defer s.PrivateChatsMu.Unlock() randID := make([]byte, 4) - rand.Read(randID) + _, _ = rand.Read(randID) + data := binary.BigEndian.Uint32(randID) s.PrivateChats[data] = &PrivateChat{ |