diff --git a/libnetwork/iptables/firewalld_test.go b/libnetwork/iptables/firewalld_test.go index 9c6cc32cd2..f613e53691 100644 --- a/libnetwork/iptables/firewalld_test.go +++ b/libnetwork/iptables/firewalld_test.go @@ -19,15 +19,11 @@ func TestFirewalldInit(t *testing.T) { } func TestReloaded(t *testing.T) { - var err error - var fwdChain *ChainInfo - iptable := GetIptable(IPv4) - fwdChain, err = iptable.NewChain("FWD", Filter, false) + fwdChain, err := iptable.NewChain("FWD", Filter, false) if err != nil { t.Fatal(err) } - bridgeName := "lo" err = iptable.ProgramChain(fwdChain, bridgeName, false, true) if err != nil { @@ -38,8 +34,8 @@ func TestReloaded(t *testing.T) { // copy-pasted from iptables_test:TestLink ip1 := net.ParseIP("192.168.1.1") ip2 := net.ParseIP("192.168.1.2") - port := 1234 - proto := "tcp" + const port = 1234 + const proto = "tcp" err = fwdChain.Link(Append, ip1, ip2, port, proto, bridgeName) if err != nil { diff --git a/libnetwork/iptables/iptables_test.go b/libnetwork/iptables/iptables_test.go index c7a2fd36fd..bdfb1721c1 100644 --- a/libnetwork/iptables/iptables_test.go +++ b/libnetwork/iptables/iptables_test.go @@ -252,8 +252,8 @@ func TestCleanup(t *testing.T) { } func TestExistsRaw(t *testing.T) { - testChain1 := "ABCD" - testChain2 := "EFGH" + const testChain1 = "ABCD" + const testChain2 = "EFGH" iptable := GetIptable(IPv4)