try to cheer up the linter again

This commit is contained in:
Arceliar 2023-05-21 12:49:49 -05:00
parent 5a6f27e732
commit e94985c583
4 changed files with 6 additions and 6 deletions

View file

@ -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)

View file

@ -13,5 +13,5 @@ func allocBytes(size int) []byte {
}
func freeBytes(bs []byte) {
bytePool.Put(bs[:0])
bytePool.Put(bs[:0]) //nolint:staticcheck
}