Update dependencies and build to go1.22 (#2113)

* Update dependencies and build to go1.22

* Fix api changes wrt to dependencies

* Update golangci config
This commit is contained in:
Wim
2024-05-23 23:44:31 +02:00
committed by GitHub
parent 56e7bd01ca
commit 2f33fe86f5
1556 changed files with 3279522 additions and 1924375 deletions

View File

@@ -10,7 +10,6 @@ import (
"context"
"fmt"
"strconv"
"sync/atomic"
"time"
waBinary "go.mau.fi/whatsmeow/binary"
@@ -18,7 +17,7 @@ import (
)
func (cli *Client) generateRequestID() string {
return cli.uniqueID + strconv.FormatUint(uint64(atomic.AddUint32(&cli.idCounter, 1)), 10)
return cli.uniqueID + strconv.FormatUint(cli.idCounter.Add(1), 10)
}
var xmlStreamEndNode = &waBinary.Node{Tag: "xmlstreamend"}
@@ -139,13 +138,15 @@ func (cli *Client) sendIQAsync(query infoQuery) (<-chan *waBinary.Node, error) {
return ch, err
}
const defaultRequestTimeout = 75 * time.Second
func (cli *Client) sendIQ(query infoQuery) (*waBinary.Node, error) {
resChan, data, err := cli.sendIQAsyncAndGetData(&query)
if err != nil {
return nil, err
}
if query.Timeout == 0 {
query.Timeout = 75 * time.Second
query.Timeout = defaultRequestTimeout
}
if query.Context == nil {
query.Context = context.Background()