Clean up linter errors

This commit is contained in:
Daniel
2019-11-07 16:13:22 +01:00
parent 35c7f4955b
commit f75fc7d162
50 changed files with 402 additions and 334 deletions

View File

@@ -85,6 +85,7 @@ func initControlLogFile() *os.File {
return initializeLogFile(logFilePath, "control/portmaster-control", info.Version())
}
//nolint:deadcode,unused // false positive on linux, currently used by windows only
func logControlError(cErr error) {
// check if error present
if cErr == nil {
@@ -110,6 +111,7 @@ func logControlError(cErr error) {
errorFile.Close()
}
//nolint:deadcode,unused // TODO
func logControlStack() {
// check logging dir
logFileBasePath := filepath.Join(logsRoot.Path, "fstree", "control")
@@ -126,10 +128,11 @@ func logControlStack() {
}
// write error and close
pprof.Lookup("goroutine").WriteTo(errorFile, 1)
_ = pprof.Lookup("goroutine").WriteTo(errorFile, 2)
errorFile.Close()
}
//nolint:deadcode,unused // false positive on linux, currently used by windows only
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)