Skip to content

Commit

Permalink
avoid use of bytes.Buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Eschenburg committed Dec 9, 2021
1 parent 007af91 commit 50ab174
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions notify_socket.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,18 +153,7 @@ func (n *notifySocket) run(pid1 int) error {
// notifyHost tells the host (usually systemd) that the container reported READY.
// Also sends MAINPID and BARRIER.
func notifyHost(client *net.UnixConn, ready []byte, pid1 int) error {
var out bytes.Buffer
_, err := out.Write(ready)
if err != nil {
return err
}

_, err = out.Write([]byte{'\n'})
if err != nil {
return err
}

_, err = client.Write(out.Bytes())
_, err := client.Write(append(ready, '\n'))
if err != nil {
return err
}
Expand Down

0 comments on commit 50ab174

Please sign in to comment.