hugobot/utils/integers.go

10 lines
139 B
Go
Raw Normal View History

2019-04-10 13:13:33 +00:00
package utils
import "encoding/binary"
func IntToBytes(x int64) []byte {
buf := make([]byte, 4)
binary.PutVarint(buf, x)
return buf
}