Skip to content

Commit

Permalink
fix: add nolint directive where necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
l-hellmann committed May 5, 2024
1 parent f08568e commit f5142e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/cmdRunner/execCmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/wg/windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -79,20 +80,23 @@ 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()

zeropsConf, err := os.OpenFile(zeropsConfPath, os.O_RDONLY, 0666)
if err != nil {
_ = os.Remove(wgConfFile)
//nolint:nilerr
return nil
}
defer zeropsConf.Close()

_, err = io.Copy(wgConf, zeropsConf)
if err != nil {
_ = os.Remove(wgConfFile)
//nolint:nilerr
return nil
}

Expand Down

0 comments on commit f5142e8

Please sign in to comment.