The following code works fine on Go 1.22, but breaks on Go 1.23.0 on the http.DefaultClient.Do() line. On Linux, it freezes the entire runtime and never continues. On macOS, it throws a fatal error: ts set in timer
package main
import (
"fmt"
"net/http"
"time"
)
func main() {
illegalTimerCopy := *time.NewTimer(10 * time.Second)
go func() {
illegalTimerCopy.Reset(10 * time.Second)
}()
req, err := http.NewRequest(http.MethodGet, "https://example.com", nil)
fmt.Println("Request created", err)
_, err = http.DefaultClient.Do(req)
fmt.Println("Request completed", err)
}
It's presumably somehow caused by the Go 1.23 timer changes, but I'm not sure how exactly, so I don't know if it's a bug or a feature. Assuming it's not a bug, it would be nice if go vet could report that similar to the mutex copy warnings.
The following code works fine on Go 1.22, but breaks on Go 1.23.0 on the
http.DefaultClient.Do()line. On Linux, it freezes the entire runtime and never continues. On macOS, it throws afatal error: ts set in timerIt's presumably somehow caused by the Go 1.23 timer changes, but I'm not sure how exactly, so I don't know if it's a bug or a feature. Assuming it's not a bug, it would be nice if
go vetcould report that similar to the mutex copy warnings.