(command byte, arg []byte)
| 17 | } |
| 18 | |
| 19 | func (c *Conn) writeCommandBuf(command byte, arg []byte) error { |
| 20 | c.ResetSequence() |
| 21 | |
| 22 | length := len(arg) + 1 |
| 23 | data := utils.ByteSliceGet(length + 4) |
| 24 | data[4] = command |
| 25 | |
| 26 | copy(data[5:], arg) |
| 27 | |
| 28 | err := c.WritePacket(data) |
| 29 | |
| 30 | utils.ByteSlicePut(data) |
| 31 | |
| 32 | return err |
| 33 | } |
| 34 | |
| 35 | func (c *Conn) writeCommandStr(command byte, arg string) error { |
| 36 | return c.writeCommandBuf(command, utils.StringToByteSlice(arg)) |
no test coverage detected