Skip to content

Commit

Permalink
Revert "chore: upgrade standard packages" due to golangci/golangci-li…
Browse files Browse the repository at this point in the history
…nt#4415

This reverts commit ad0c6d5.
  • Loading branch information
andig committed Feb 25, 2024
1 parent ad0c6d5 commit 2061dd3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions hems/ocpp/ocpp.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package ocpp

import (
"fmt"
"math/rand/v2"
"math/rand"
"strings"
"time"

Expand Down Expand Up @@ -43,7 +43,7 @@ func New(conf map[string]interface{}, site site.API) (*OCPP, error) {
if err == nil {
cc.StationID = fmt.Sprintf("evcc-%s", strings.ToLower(id))
} else {
cc.StationID = fmt.Sprintf("evcc-%d", rand.Uint32())
cc.StationID = fmt.Sprintf("evcc-%d", rand.Int31())
}
log.DEBUG.Println("station id:", cc.StationID)
}
Expand Down
5 changes: 3 additions & 2 deletions provider/mqtt/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package mqtt
import (
"crypto/tls"
"fmt"
"math/rand/v2"
"math/rand"
"strings"
"sync"
"sync/atomic"
Expand All @@ -20,7 +20,8 @@ var Instance *Client

// ClientID created unique mqtt client id
func ClientID() string {
return fmt.Sprintf("evcc-%d", rand.Uint32())
pid := rand.Int31()
return fmt.Sprintf("evcc-%d", pid)
}

// Config is the public configuration
Expand Down

0 comments on commit 2061dd3

Please sign in to comment.