mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-12-23 08:45:39 +00:00
cheer up the linter
This commit is contained in:
parent
8b5add5301
commit
5a6f27e732
@ -184,7 +184,7 @@ func (c *Core) MTU() uint64 {
|
|||||||
|
|
||||||
func (c *Core) ReadFrom(p []byte) (n int, from net.Addr, err error) {
|
func (c *Core) ReadFrom(p []byte) (n int, from net.Addr, err error) {
|
||||||
buf := allocBytes(int(c.PacketConn.MTU()))
|
buf := allocBytes(int(c.PacketConn.MTU()))
|
||||||
defer freeBytes(buf)
|
defer freeBytes(buf) //nolint:staticcheck
|
||||||
for {
|
for {
|
||||||
bs := buf
|
bs := buf
|
||||||
n, from, err = c.PacketConn.ReadFrom(bs)
|
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) {
|
func (c *Core) WriteTo(p []byte, addr net.Addr) (n int, err error) {
|
||||||
buf := allocBytes(0)
|
buf := allocBytes(0)
|
||||||
defer freeBytes(buf)
|
defer freeBytes(buf) //nolint:staticcheck
|
||||||
buf = append(buf, typeSessionTraffic)
|
buf = append(buf, typeSessionTraffic)
|
||||||
buf = append(buf, p...)
|
buf = append(buf, p...)
|
||||||
n, err = c.PacketConn.WriteTo(buf, addr)
|
n, err = c.PacketConn.WriteTo(buf, addr)
|
||||||
|
Loading…
Reference in New Issue
Block a user