mirror of
https://github.com/go-i2p/goSam.git
synced 2025-06-07 17:05:01 -04:00
- Remove unneeded rand.Seed()
invocation. Not needed since go 1.20
- go-staticcheck
This commit is contained in:
@ -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]
|
||||
|
11
sessions.go
11
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.
|
||||
|
Reference in New Issue
Block a user