[go-nuts] Re: synctest and test examples

2025-09-07 Thread Jason E. Aten
Since synctest runs on a fake clock, doing anything "automatically" with it seems like a bad idea. You very much want to know when you are using it, and most Examples to this point (presumably a sizable set), have no idea about synctest, since it didn't exist when they were written, that would r

Re: [go-nuts] Re: synctest and test examples

2025-09-06 Thread Jason E. Aten
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=imported

Re: [go-nuts] Re: synctest and test examples

2025-09-05 Thread 'Axel Wagner' via golang-nuts
On Fri, 5 Sept 2025 at 22:14, Jason E. Aten 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.