Skip to content

Commit

Permalink
Fix govet errors in utils/daemonize.go
Browse files Browse the repository at this point in the history
  • Loading branch information
cce committed Jun 14, 2019
1 parent 187f645 commit 51b462c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions utils/daemonize.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@ func Daemonize(logFilePath, pidFilePath string) {
if os.Getenv("__DAEMON_CWD") == "" {
cwd, err := os.Getwd()
if err != nil {
fmt.Fprintln(os.Stderr, "Cannot determine working directory: %v", err)
fmt.Fprintf(os.Stderr, "Cannot determine working directory: %v\n", err)
os.Exit(1)
}
os.Setenv("__DAEMON_CWD", cwd)
}

logFile, err := os.OpenFile(logFilePath, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0666)
if err != nil {
fmt.Fprintln(os.Stderr, "Could not open local log file: %v", err)
fmt.Fprintf(os.Stderr, "Could not open local log file: %v\n", err)
os.Exit(1)
}

stdout, stderr, err := godaemon.MakeDaemon(&godaemon.DaemonAttr{CaptureOutput: true})
if err != nil {
fmt.Fprintln(os.Stderr, "Could not Daemonize: %v", err)
fmt.Fprintf(os.Stderr, "Could not Daemonize: %v\n", err)
os.Exit(1)
}

Expand All @@ -56,7 +56,7 @@ func Daemonize(logFilePath, pidFilePath string) {
lock, err := lockfile.New(pidFilePath)
err = lock.TryLock()
if err != nil {
fmt.Println("Cannot lock \"%v\": %v", lock, err)
fmt.Fprintf(os.Stderr, "Cannot lock \"%v\": %v\n", lock, err)
os.Exit(1)
}

Expand Down

0 comments on commit 51b462c

Please sign in to comment.