公告板
版本库
filestore
活动
搜索
登录
aps
/
plc-recorder
plc-recorder
概况
操作记录
提交次数
目录
文档
派生
对比
blame
|
历史
|
原始文档
修改上报的数据结构, 添加plc查询接口
zhangzengfei
2023-08-11
bc0b7e914a378b2c40f9d2ec2470b61a19c18288
[aps/plc-recorder.git]
/
util
/
util.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package util
import (
"bytes"
"encoding/binary"
)
func IntToBytes(n int) []byte {
x := int32(n)
bytesBuffer := bytes.NewBuffer([]byte{})
binary.Write(bytesBuffer, binary.LittleEndian, x)
return bytesBuffer.Bytes()
}