concourse / concourse

Use fmt.Fprint instead of (io.Writer).Write along with fmt.Sprint GO-P4007
Performance
Major
4 months agoa year old
fmt.Fprintf(conn, "roundtripped %s", <-expectedRoundtrip) should be preferred to the conn.Write([]byte(fmt.Sprintf("roundtripped %s", <-expectedRoundtrip)))
1487					),
1488					stdoutStream("foo-handle", "process-handle", 123, func(conn net.Conn) {
1489						conn.Write([]byte("stdout data"))
1490						conn.Write([]byte(fmt.Sprintf("roundtripped %s", <-expectedRoundtrip)))1491					}),
1492					stderrStream("foo-handle", "process-handle", 123, func(conn net.Conn) {
1493						conn.Write([]byte("stderr data"))
fmt.Fprintf(conn, "roundtripped %s", <-stdInContent) should be preferred to the conn.Write([]byte(fmt.Sprintf("roundtripped %s", <-stdInContent)))
1134					),
1135					stdoutStream("foo-handle", "process-handle", 123, func(conn net.Conn) {
1136						conn.Write([]byte("stdout data"))
1137						conn.Write([]byte(fmt.Sprintf("roundtripped %s", <-stdInContent)))1138					}),
1139					emptyStderrStream("foo-handle", "process-handle", 123),
1140				)
fmt.Fprintf(conn, "roundtripped %s", <-stdInContent) should be preferred to the conn.Write([]byte(fmt.Sprintf("roundtripped %s", <-stdInContent)))
1011					),
1012					stdoutStream("foo-handle", "process-handle", 123, func(conn net.Conn) {
1013						conn.Write([]byte("stdout data"))
1014						conn.Write([]byte(fmt.Sprintf("roundtripped %s", <-stdInContent)))1015					}),
1016					stderrStream("foo-handle", "process-handle", 123, func(conn net.Conn) {
1017						conn.Write([]byte("stderr data"))