From f8e4cd540b87de3e308ec18a2b040b284a741522 Mon Sep 17 00:00:00 2001 From: Jeff Halter <868228+jhalter@users.noreply.github.com> Date: Mon, 17 Jun 2024 19:51:37 -0700 Subject: Clean up various linter warnings --- hotline/server.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'hotline/server.go') 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{ -- cgit