Skip to content

bugfix: serial enumerator failures in some rare circumstances #830

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Sep 14, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Use io.Discard instead of custom nullWriter
  • Loading branch information
cmaglie committed Sep 12, 2023
commit 3b5be9f985609be639976c71c6479b5fd609c45d
7 changes: 2 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
_ "embed"
"encoding/json"
"flag"
"io"
"os"
"os/exec"
"runtime"
Expand Down Expand Up @@ -99,10 +100,6 @@ var (
Systray systray.Systray
)

type nullWriter int

func (nullWriter) Write([]byte) (int, error) { return 0, nil }

type logWriter struct{}

func (u *logWriter) Write(p []byte) (n int, err error) {
Expand Down Expand Up @@ -322,7 +319,7 @@ func loop() {

if !*verbose {
log.Println("You can enter verbose mode to see all logging by starting with the -v command line switch.")
log.SetOutput(new(nullWriter)) //route all logging to nullwriter
log.SetOutput(io.Discard)
}

// save crashreport to file
Expand Down