I don't have the post context, but at 13 lines, I feel even something like Go wouldn't even be considerably larger or marginally easier to understand.
package main
import ("os"; "io")
func main() {
io.Copy(os.Stdout, os.Stdin)
}Any ideas if this dest<-src order is by design following go design principles or was mainly authors' personal choice?
By the way, Pipe in the same package is the other way around: (PipeReader, PipeWriter)
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.