Extracted from go1.19.1/src/cmd/go/internal/robustio
There is only one modification:
internal/syscall/windows