3 ms·
What is the benefit of re-using the 'client' identifier? There's no closure capturing the identifier. Compare: client, server := net.Pipe() va
by gohrt 11y ago
What is the benefit of re-using the 'client' identifier? There's no closure capturing the identifier.
Compare:
client, server := net.Pipe()
var buf bytes.Buffer
client = &recordingConn {
Conn: client,
Writer: io.MultiWriter(client, &buf),
}
vs
tempClient, server := net.Pipe()
var buf bytes.Buffer
client = &recordingConn {
Conn: tempClient,
Writer: io.MultiWriter(tempClient, &buf),
}
The latter is less confusing to me.
- deleted 11y ago[deleted]
- deleted 11y ago[deleted]