Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3b5be9f

Browse files
committedSep 12, 2023
Use io.Discard instead of custom nullWriter
1 parent b2bceb6 commit 3b5be9f

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed
 

‎main.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
_ "embed"
2323
"encoding/json"
2424
"flag"
25+
"io"
2526
"os"
2627
"os/exec"
2728
"runtime"
@@ -99,10 +100,6 @@ var (
99100
Systray systray.Systray
100101
)
101102

102-
type nullWriter int
103-
104-
func (nullWriter) Write([]byte) (int, error) { return 0, nil }
105-
106103
type logWriter struct{}
107104

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

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

328325
// save crashreport to file

0 commit comments

Comments
 (0)
Please sign in to comment.