Fair point. And after a while, presumably it would give synctest quite alot of regular testing what with running examples so often, which could help catch any regressions.
Given that there are only three of us using synctest publicly, according to https://pkg.go.dev/testing/synctest?tab=importedby , it certainly would be nice to have more tests use it. Seems like a pretty simple addition to add some kind of SynctestExample that runs the test in synctest bubble. On Saturday, September 6, 2025 at 5:19:37 AM UTC+1 Axel Wagner wrote: > On Fri, 5 Sept 2025 at 22:14, Jason E. Aten <j.e....@gmail.com> wrote: > >> Moreover its easy to just write a regular test. I would just write a >> regular >> Test func and put the word "Example" in a comment above it. >> Same result, no? >> > > No, example functions are exposed in package docs (with `go doc -http` or > on pkg.go.dev) and can be run directly from the browser: > https://go.dev/blog/examples > > I agree with you that we don't want to do it automatically, but it would > be useful to have a way to do it at all. > > >> >> On Friday, September 5, 2025 at 7:19:36 PM UTC+1 Pierre Durand wrote: >> >>> Using synctest requires to have access to a *testing.T >>> This is not available from an example testing function. >>> >>> Should we automatically run examples in a synctest time bubble ? >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "golang-nuts" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to golang-nuts...@googlegroups.com. >> To view this discussion visit >> https://groups.google.com/d/msgid/golang-nuts/a088adf2-f4f8-47eb-879b-222714670be5n%40googlegroups.com >> >> <https://groups.google.com/d/msgid/golang-nuts/a088adf2-f4f8-47eb-879b-222714670be5n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/de933094-e244-4768-9066-aaacda84d5a8n%40googlegroups.com.