enable gosimple linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
@ -369,7 +369,7 @@ func cmdAdd(args *skel.CmdArgs) error {
|
||||
updateResultsMacAddr(tuningConf, args.IfName, tuningConf.Mac)
|
||||
}
|
||||
|
||||
if tuningConf.Promisc != false {
|
||||
if tuningConf.Promisc {
|
||||
if err = changePromisc(args.IfName, true); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -514,7 +514,7 @@ func validateSysctlConf(tuningConf *TuningConf) error {
|
||||
return err
|
||||
}
|
||||
if !match {
|
||||
return errors.New(fmt.Sprintf("Sysctl %s is not allowed. Only the following sysctls are allowed: %+v", sysctl, allowlist))
|
||||
return fmt.Errorf("Sysctl %s is not allowed. Only the following sysctls are allowed: %+v", sysctl, allowlist)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
@ -579,7 +579,7 @@ func validateSysctlConflictingKeys(data []byte) error {
|
||||
|
||||
func validateArgs(args *skel.CmdArgs) error {
|
||||
if strings.Contains(args.IfName, string(os.PathSeparator)) {
|
||||
return errors.New(fmt.Sprintf("Interface name (%s) contains an invalid character %s", args.IfName, string(os.PathSeparator)))
|
||||
return fmt.Errorf("Interface name (%s) contains an invalid character %s", args.IfName, string(os.PathSeparator))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user