enable gosimple linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
@ -167,7 +167,7 @@ func isolationStage2BridgeRule(bridgeName string) []string {
|
||||
}
|
||||
|
||||
func withDefaultComment(rule []string) []string {
|
||||
defaultComment := fmt.Sprintf("CNI firewall plugin rules (ingressPolicy: same-bridge)")
|
||||
defaultComment := "CNI firewall plugin rules (ingressPolicy: same-bridge)"
|
||||
return withComment(rule, defaultComment)
|
||||
}
|
||||
|
||||
|
@ -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