From 46dc100b375a8668ef17ab2e097473a57dbfdc4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Tue, 22 Feb 2022 20:26:02 +0100 Subject: [PATCH] Reuse buffer --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 51d1430..f0facbe 100644 --- a/main.go +++ b/main.go @@ -43,8 +43,8 @@ func main() { } defer l.Close() + buf := make([]byte, 1024) for { - buf := make([]byte, 1024) n, raddr, err := l.ReadFrom(buf) log.Printf("received packet %d\n", n)