Remove explicit error check at end of functions to placate lint

It's sad because this changes a regular pattern into an irregular one,
which will create spurious diffs if more work is added at the end of
the function.  Still, this is easier than fixing the lint runner to
ignore the report.
This commit is contained in:
Bryan Boreham committed 2017-10-04 13:40:13 +00:00
1 parent c16653a396
commit 35c017a787
7 files changed
+14 -62

No files matched your search

+2 -9
View File
@@ -218,11 +218,7 @@ func SetupIface(ifaceName, newIfName string) error {
if err := ConfigureARPCache("/proc", newIfName); err != nil {
return err
}
if err := ipt.Append("filter", "INPUT", "-i", newIfName, "-d", "224.0.0.0/4", "-j", "DROP"); err != nil {
return err
}
return nil
return ipt.Append("filter", "INPUT", "-i", newIfName, "-d", "224.0.0.0/4", "-j", "DROP")
}
// NB: This function can be used only by a process that terminates immediately
@@ -332,8 +328,5 @@ func ExposeNAT(ipnet net.IPNet) error {
if err := addNatRule(ipt, "-d", cidr, "!", "-s", cidr, "-j", "MASQUERADE"); err != nil {
return err
}
if err := addNatRule(ipt, "-s", cidr, "!", "-d", cidr, "-j", "MASQUERADE"); err != nil {
return err
}
return nil
return addNatRule(ipt, "-s", cidr, "!", "-d", cidr, "-j", "MASQUERADE")
}