uint64 to byte golang code example
Example 1: golang convert string to int64
s := "97"
n, err := strconv.ParseInt(s, 10, 64)
if err == nil {
fmt.Printf("%d of type %T", n, n)
}
Example 2: uint64 to byte golang
i := int64(-123456789)
fmt.Println(i)
b := make([]byte, 8)
binary.LittleEndian.PutUint64(b, uint64(i))
fmt.Println(b)
i = int64(binary.LittleEndian.Uint64(b))
fmt.Println(i)