From 27d0f23f41b65de93b8f623be0ba3f5145196869 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 7 Jun 2021 11:20:39 +0200 Subject: [PATCH] Implement review suggestions --- cmds/portmaster-start/lock.go | 1 + cmds/portmaster-start/logs.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmds/portmaster-start/lock.go b/cmds/portmaster-start/lock.go index 07fe0988..9635744d 100644 --- a/cmds/portmaster-start/lock.go +++ b/cmds/portmaster-start/lock.go @@ -85,6 +85,7 @@ func createInstanceLock(lockFilePath string) error { } // create lock file + // TODO: Investigate required permissions. err = ioutil.WriteFile(lockFilePath, []byte(fmt.Sprintf("%d", os.Getpid())), 0666) //nolint:gosec if err != nil { return err diff --git a/cmds/portmaster-start/logs.go b/cmds/portmaster-start/logs.go index c982febb..34f00867 100644 --- a/cmds/portmaster-start/logs.go +++ b/cmds/portmaster-start/logs.go @@ -96,7 +96,7 @@ func getPmStartLogFile(ext string) *os.File { }, info.Version(), ext) } -//nolint:unused // false positive on linux, currently used by windows only +//nolint:unused // false positive on linux, currently used by windows only. TODO: move to a _windows file. func logControlError(cErr error) { // check if error present if cErr == nil { @@ -112,7 +112,7 @@ func logControlError(cErr error) { fmt.Fprintln(errorFile, cErr.Error()) } -//nolint:deadcode,unused // false positive on linux, currently used by windows only +//nolint:deadcode,unused // false positive on linux, currently used by windows only. TODO: move to a _windows file. func runAndLogControlError(wrappedFunc func(cmd *cobra.Command, args []string) error) func(cmd *cobra.Command, args []string) error { return func(cmd *cobra.Command, args []string) error { err := wrappedFunc(cmd, args)