From 6f19c4381e13453fbc8745b7294736fd44abbf7b Mon Sep 17 00:00:00 2001 From: Matt Layher Date: Thu, 9 Dec 2021 17:08:38 -0500 Subject: [PATCH] nftables: fix staticcheck error for Conn.getObj (#137) Signed-off-by: Matt Layher --- obj.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/obj.go b/obj.go index 72936bd..a88aed4 100644 --- a/obj.go +++ b/obj.go @@ -185,15 +185,15 @@ func (cc *Conn) getObj(o Obj, t *Table, msgType uint16) ([]Obj, error) { if o != nil { data, err = o.marshal(false) - if err != nil { - return nil, err - } } else { flags = netlink.Dump data, err = netlink.MarshalAttributes([]netlink.Attribute{ {Type: unix.NFTA_RULE_TABLE, Data: []byte(t.Name + "\x00")}, }) } + if err != nil { + return nil, err + } message := netlink.Message{ Header: netlink.Header{