From d741264626444cf73d99cedb3cd4d8abe9ea1bf5 Mon Sep 17 00:00:00 2001 From: Julian Kornberger Date: Sun, 30 Sep 2018 22:42:33 +0200 Subject: [PATCH] Reduce allocations --- netlink.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/netlink.go b/netlink.go index fb15952..9cb685d 100644 --- a/netlink.go +++ b/netlink.go @@ -27,7 +27,8 @@ func ParseIPNet(s string) (*net.IPNet, error) { if err != nil { return nil, err } - return &net.IPNet{IP: ip, Mask: ipNet.Mask}, nil + ipNet.IP = ip + return ipNet, nil } // NewIPNet generates an IPNet from an ip address using a netmask of 32 or 128.