mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
try to cheer up the linter again
This commit is contained in:
parent
5a6f27e732
commit
e94985c583
4 changed files with 6 additions and 6 deletions
|
@ -184,7 +184,7 @@ func (c *Core) MTU() uint64 {
|
|||
|
||||
func (c *Core) ReadFrom(p []byte) (n int, from net.Addr, err error) {
|
||||
buf := allocBytes(int(c.PacketConn.MTU()))
|
||||
defer freeBytes(buf) //nolint:staticcheck
|
||||
defer freeBytes(buf)
|
||||
for {
|
||||
bs := buf
|
||||
n, from, err = c.PacketConn.ReadFrom(bs)
|
||||
|
@ -219,7 +219,7 @@ func (c *Core) ReadFrom(p []byte) (n int, from net.Addr, err error) {
|
|||
|
||||
func (c *Core) WriteTo(p []byte, addr net.Addr) (n int, err error) {
|
||||
buf := allocBytes(0)
|
||||
defer freeBytes(buf) //nolint:staticcheck
|
||||
defer freeBytes(buf)
|
||||
buf = append(buf, typeSessionTraffic)
|
||||
buf = append(buf, p...)
|
||||
n, err = c.PacketConn.WriteTo(buf, addr)
|
||||
|
|
|
@ -13,5 +13,5 @@ func allocBytes(size int) []byte {
|
|||
}
|
||||
|
||||
func freeBytes(bs []byte) {
|
||||
bytePool.Put(bs[:0])
|
||||
bytePool.Put(bs[:0]) //nolint:staticcheck
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue