Skip to content

Commit 055b599

Browse files
committed
fix: linter error
1 parent 1ffcf9c commit 055b599

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

example/chi/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func main() {
3737
logger.Infof("Hello")
3838
logger.Warnf("World")
3939

40-
fmt.Fprintf(w, "OK\n")
40+
_, _ = fmt.Fprintf(w, "OK\n")
4141
})
4242

4343
// Run server

example/net_http/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func main() {
2121
logger.Infof("Hello")
2222
logger.Warnf("World")
2323

24-
fmt.Fprintf(w, "OK\n")
24+
_, _ = fmt.Fprintf(w, "OK\n")
2525
})
2626

2727
projectId := "my-gcp-project"

stackdriver_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func TestIntegration(t *testing.T) {
2626
logger.Warnf("3")
2727
logger.Errorf("4")
2828

29-
fmt.Fprintf(w, "OK\n")
29+
_, _ = fmt.Fprintf(w, "OK\n")
3030
})
3131

3232
requestLogOut := new(bytes.Buffer)
@@ -84,7 +84,7 @@ func TestIntegration(t *testing.T) {
8484
}
8585

8686
// check context log
87-
logs := strings.Split(string(contextLogOut.Bytes()), "\n")
87+
logs := strings.Split(contextLogOut.String(), "\n")
8888
logs = logs[:len(logs)-1]
8989
logExpected := []struct {
9090
Severity string
@@ -128,7 +128,7 @@ func TestNoContextLog(t *testing.T) {
128128

129129
mux := http.NewServeMux()
130130
mux.HandleFunc("/foo", func(w http.ResponseWriter, r *http.Request) {
131-
fmt.Fprintf(w, "OK\n")
131+
_, _ = fmt.Fprintf(w, "OK\n")
132132
})
133133

134134
requestLogOut := new(bytes.Buffer)
@@ -174,6 +174,6 @@ func TestNoContextLog(t *testing.T) {
174174
}
175175

176176
if len(contextLogOut.Bytes()) != 0 {
177-
t.Errorf("context log exists: %s", string(contextLogOut.Bytes()))
177+
t.Errorf("context log exists: %s", contextLogOut.String())
178178
}
179179
}

0 commit comments

Comments
 (0)