"bytes"
log.Printf("[%2x] data:[%2x]", this.command_buffer, data)
this.command_buffer.Reset()
this.command_buffer.Write(left_bytes)
this.command_buffer.Write(data)
this.command_buffer.Write(right_bytes)
log.Printf("[%2x]", this.command_buffer)
this.command_pos += len(data)
2017/05/15 16:31:34 left_bytes:[aa] right_bytes:[aaaa] data:[d] len:(1)
2017/05/15 16:31:34 [616161616161] data:[64]
2017/05/15 16:31:34 [61616464616161]
2017/05/15 16:31:34 command aaddaaa
这是不是个bug,我加入一个64到buffer里面,结果打印的时候,变成2个了..
有疑问加站长微信联系(非本文作者)