enable gocritic linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
@ -334,7 +334,7 @@ func cmdAdd(args *skel.CmdArgs) error {
|
||||
|
||||
err = ns.WithNetNSPath(args.Netns, func(_ ns.NetNS) error {
|
||||
for key, value := range tuningConf.SysCtl {
|
||||
key = strings.Replace(key, ".", string(os.PathSeparator), -1)
|
||||
key = strings.ReplaceAll(key, ".", string(os.PathSeparator))
|
||||
|
||||
// If the key contains `IFNAME` - substitute it with args.IfName
|
||||
// to allow setting sysctls on a particular interface, on which
|
||||
@ -439,7 +439,7 @@ func cmdCheck(args *skel.CmdArgs) error {
|
||||
err = ns.WithNetNSPath(args.Netns, func(_ ns.NetNS) error {
|
||||
// Check each configured value vs what's currently in the container
|
||||
for key, confValue := range tuningConf.SysCtl {
|
||||
fileName := filepath.Join("/proc/sys", strings.Replace(key, ".", "/", -1))
|
||||
fileName := filepath.Join("/proc/sys", strings.ReplaceAll(key, ".", "/"))
|
||||
|
||||
contents, err := os.ReadFile(fileName)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user