From 7ac12aa540d09dea25140e5c20b0a2e1bf2de2af Mon Sep 17 00:00:00 2001 From: urgentquest Date: Fri, 9 May 2025 00:45:40 +0000 Subject: [PATCH] - Remove unneeded `rand.Seed()` invocation. Not needed since go 1.20 - go-staticcheck --- replyParser.go | 4 ++-- sessions.go | 11 ----------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/replyParser.go b/replyParser.go index 98a9f4e..31e80a0 100644 --- a/replyParser.go +++ b/replyParser.go @@ -57,7 +57,7 @@ func parseReply(line string) (*Reply, error) { line = strings.TrimSpace(line) parts := strings.Split(line, " ") if len(parts) < 3 { - return nil, fmt.Errorf("Malformed Reply.\n%s\n", line) + return nil, fmt.Errorf("malformed Reply.\n%s", line) } preParseReply := func() []string { val := "" @@ -98,7 +98,7 @@ func parseReply(line string) (*Reply, error) { kvPair := strings.SplitN(v, "=", 2) if kvPair != nil { if len(kvPair) != 2 { - return nil, fmt.Errorf("Malformed key-value-pair len != 2.\n%s\n", kvPair) + return nil, fmt.Errorf("malformed key-value-pair len != 2.\n%s", kvPair) } } r.Pairs[kvPair[0]] = kvPair[len(kvPair)-1] diff --git a/sessions.go b/sessions.go index 907d4c6..2b74e9c 100644 --- a/sessions.go +++ b/sessions.go @@ -1,16 +1,5 @@ package gosam -import ( - - // "math" - "math/rand" - "time" -) - -func init() { - rand.Seed(time.Now().UnixNano()) -} - // CreateSession creates a new Session of type style, with an optional destination. // an empty destination is interpreted as "TRANSIENT" // Returns the destination for the new Client or an error.