From f5142e8c8c80d51d38e5212ab9ea7758dd4ff7c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hellmann?= Date: Sun, 5 May 2024 12:25:01 +0200 Subject: [PATCH] fix: add nolint directive where necessary --- src/cmdRunner/execCmd.go | 1 + src/wg/windows.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/cmdRunner/execCmd.go b/src/cmdRunner/execCmd.go index 0db04086..598273a6 100644 --- a/src/cmdRunner/execCmd.go +++ b/src/cmdRunner/execCmd.go @@ -16,6 +16,7 @@ func CommandContext(ctx context.Context, cmd string, args ...string) *ExecCmd { type ExecCmd struct { *exec.Cmd + //nolint:containedctx ctx context.Context before Func after Func diff --git a/src/wg/windows.go b/src/wg/windows.go index 325bf105..a7ae1c19 100644 --- a/src/wg/windows.go +++ b/src/wg/windows.go @@ -66,6 +66,7 @@ func beforeUp(zeropsConfPath string) cmdRunner.Func { wgConfigDir := filepath.Join(programFiles, "WireGuard", "Data", "Configurations") stat, err := os.Stat(wgConfigDir) if err != nil { + //nolint:nilerr return nil } if !stat.IsDir() { @@ -79,6 +80,7 @@ func beforeUp(zeropsConfPath string) cmdRunner.Func { wgConf, err := os.OpenFile(filepath.Join(wgConfigDir, constants.WgConfigFile), os.O_WRONLY|os.O_CREATE, 0666) if err != nil { + //nolint:nilerr return nil } defer wgConf.Close() @@ -86,6 +88,7 @@ func beforeUp(zeropsConfPath string) cmdRunner.Func { zeropsConf, err := os.OpenFile(zeropsConfPath, os.O_RDONLY, 0666) if err != nil { _ = os.Remove(wgConfFile) + //nolint:nilerr return nil } defer zeropsConf.Close() @@ -93,6 +96,7 @@ func beforeUp(zeropsConfPath string) cmdRunner.Func { _, err = io.Copy(wgConf, zeropsConf) if err != nil { _ = os.Remove(wgConfFile) + //nolint:nilerr return nil }