mirror of
https://github.com/golang/net.git
synced 2026-03-31 10:27:08 +09:00
WithCancel, and WithTimeout to use different concrete types. Update the tests and documentation. This change reduces the size of context structs, reduces the number of allocations (see TestAllocs) and removes unnecessary pointers from the heap, such as the timer field for non-timer contexts. IMPORTANT: I've removed the code in these functions that handles nil Context parameters. Passing a nil parent Context will now cause a panic. LGTM=bcmills R=bcmills, crawshaw CC=adonovan, golang-codereviews, rsc https://golang.org/cl/116400043