You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-1Lines changed: 7 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -368,7 +368,13 @@ Also a bad solution would be to simply replace all `require` in goroutines with
368
368
369
369
The checker is enabled by default, because `testinggoroutine` is enabled by default in `go vet`.
370
370
371
-
P.S. Related `testify`'s [thread](https://github.com/stretchr/testify/issues/772).
371
+
In addition, the checker warns about `require` in HTTP handlers (functions and methods whose signature matches
372
+
[http.HandlerFunc](https://pkg.go.dev/net/http#HandlerFunc)), because handlers run in a separate
373
+
[service goroutine](https://cs.opensource.google/go/go/+/refs/tags/go1.22.3:src/net/http/server.go;l=2782;drc=1d45a7ef560a76318ed59dfdb178cecd58caf948) that
374
+
services the HTTP connection. Terminating these goroutines can lead to undefined behaviour and difficulty debugging tests.
375
+
You can turn off the check using the `--go-require.ignore-http-handlers` flag.
376
+
377
+
P.S. Look at [testify's issue](https://github.com/stretchr/testify/issues/772), related to assertions in the goroutines.
0 commit comments