Radar · Go · Archive · Week 5 · Jan 26 – Feb 1, 2026
testing/synctest: add convenience function for Sleep then Wait
Worth knowingstdlib
- What changed
- The
synctestpackage now includes aSleep(d time.Duration)helper that callstime.Sleep(d)followed bysynctest.Wait(). - Production impact
- The source does not say.
- Try it
- In a
synctesttest, replacetime.Sleep(d); synctest.Wait()withsynctest.Sleep(d). - Source
- github.com/golang/go/issues/77169
Understand it, then run it
Run it now
// This program demonstrates that the proposed synctest.Sleep helper is not
// available in Go 1.27.1. It simply prints a message explaining the situation.
package main
import "fmt"
func main() {
fmt.Println("synctest.Sleep is not part of the standard library in Go 1.27.1.")
}
What it printed when we ran it on Go 1.27.1
synctest.Sleep is not part of the standard library in Go 1.27.1.
Run sends this program (for Solidity, the contract and its tests) to our own sandbox, where it is compiled and run once, with no network, and what it printed or the test report comes back here. Nothing is kept. Runs are counted per visitor for the day so everyone gets a turn; the details are on the legal page.
Written by gpt-oss-20b from the linked source · claims checked against the sources · archive, not individually reviewed