1package plugin 2 3import ( 4 "io" 5 "log" 6) 7 8func copyStream(name string, dst io.Writer, src io.Reader) { 9 if src == nil { 10 panic(name + ": src is nil") 11 } 12 if dst == nil { 13 panic(name + ": dst is nil") 14 } 15 if _, err := io.Copy(dst, src); err != nil && err != io.EOF { 16 log.Printf("[ERR] plugin: stream copy '%s' error: %s", name, err) 17 } 18} 19