redundant if ...; err != nil check, just return error instead.
133 return err
134 }
135
136 if err := c.VSwitch.AddPort(n.Cfg.ShortName, link.Attrs().Name); err != nil {137 return err
138 }
139
Description
Some simple error checking patterns can be reduced to just a single return
statement returning a variable of type Error
.
Bad practice
if err != nil {
return err
}
return nil
Recommended
return err