3 ms·
It is by design. All those work in the same direction: dest = src // Variable assignment. <-ch; // Read from channel. // in net/http type Handl
by tcard 13y ago
It is by design. All those work in the same direction:
dest = src // Variable assignment.
<-ch; // Read from channel.
// in net/http
type HandlerFunc func(w ResponseWriter, req *Request)
// in io
func Copy(dst Writer, src Reader)
// builtin
copy(dst, src) // Slices.
So the reason is consistency. I suppose the Pipe exception is to map Unix's pipes.