mirror of
https://github.com/pion/stun.git
synced 2025-09-26 20:01:18 +08:00
Interface{} can be replaced by any
Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
This commit is contained in:
@@ -319,7 +319,7 @@ func (t *clientTransaction) handle(e Event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var clientTransactionPool = &sync.Pool{ //nolint:gochecknoglobals
|
var clientTransactionPool = &sync.Pool{ //nolint:gochecknoglobals
|
||||||
New: func() interface{} {
|
New: func() any {
|
||||||
return &clientTransaction{
|
return &clientTransaction{
|
||||||
raw: make([]byte, 1500),
|
raw: make([]byte, 1500),
|
||||||
}
|
}
|
||||||
@@ -562,7 +562,7 @@ func (s *callbackWaitHandler) setCallback(f func(event Event)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var callbackWaitHandlerPool = sync.Pool{ //nolint:gochecknoglobals
|
var callbackWaitHandlerPool = sync.Pool{ //nolint:gochecknoglobals
|
||||||
New: func() interface{} {
|
New: func() any {
|
||||||
return &callbackWaitHandler{
|
return &callbackWaitHandler{
|
||||||
cond: sync.NewCond(new(sync.Mutex)),
|
cond: sync.NewCond(new(sync.Mutex)),
|
||||||
}
|
}
|
||||||
@@ -618,7 +618,7 @@ type buffer struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var bufferPool = &sync.Pool{ //nolint:gochecknoglobals
|
var bufferPool = &sync.Pool{ //nolint:gochecknoglobals
|
||||||
New: func() interface{} {
|
New: func() any {
|
||||||
return &buffer{buf: make([]byte, 2048)}
|
return &buffer{buf: make([]byte, 2048)}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@@ -38,7 +38,7 @@ func (h *hmac) resetTo(key []byte) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var hmacSHA1Pool = &sync.Pool{ //nolint:gochecknoglobals
|
var hmacSHA1Pool = &sync.Pool{ //nolint:gochecknoglobals
|
||||||
New: func() interface{} {
|
New: func() any {
|
||||||
h := New(sha1.New, make([]byte, sha1.BlockSize))
|
h := New(sha1.New, make([]byte, sha1.BlockSize))
|
||||||
|
|
||||||
return h
|
return h
|
||||||
@@ -62,7 +62,7 @@ func PutSHA1(h hash.Hash) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var hmacSHA256Pool = &sync.Pool{ //nolint:gochecknoglobals
|
var hmacSHA256Pool = &sync.Pool{ //nolint:gochecknoglobals
|
||||||
New: func() interface{} {
|
New: func() any {
|
||||||
h := New(sha256.New, make([]byte, sha256.BlockSize))
|
h := New(sha256.New, make([]byte, sha256.BlockSize))
|
||||||
|
|
||||||
return h
|
return h
|
||||||
|
Reference in New Issue
Block a user