Implement review suggestions
This commit is contained in:
@@ -85,6 +85,7 @@ func createInstanceLock(lockFilePath string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create lock file
|
// create lock file
|
||||||
|
// TODO: Investigate required permissions.
|
||||||
err = ioutil.WriteFile(lockFilePath, []byte(fmt.Sprintf("%d", os.Getpid())), 0666) //nolint:gosec
|
err = ioutil.WriteFile(lockFilePath, []byte(fmt.Sprintf("%d", os.Getpid())), 0666) //nolint:gosec
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ func getPmStartLogFile(ext string) *os.File {
|
|||||||
}, info.Version(), ext)
|
}, 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) {
|
func logControlError(cErr error) {
|
||||||
// check if error present
|
// check if error present
|
||||||
if cErr == nil {
|
if cErr == nil {
|
||||||
@@ -112,7 +112,7 @@ func logControlError(cErr error) {
|
|||||||
fmt.Fprintln(errorFile, 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 {
|
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 {
|
return func(cmd *cobra.Command, args []string) error {
|
||||||
err := wrappedFunc(cmd, args)
|
err := wrappedFunc(cmd, args)
|
||||||
|
|||||||
Reference in New Issue
Block a user