mirror of
https://github.com/safing/portmaster
synced 2025-09-02 02:29:12 +00:00
Implement review suggestions
This commit is contained in:
parent
ce192c7243
commit
27d0f23f41
2 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue