Answers for "uint64 to byte golang"

Go
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)
}
Posted by: Guest on May-09-2020
0

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)
Posted by: Guest on January-29-2021

Browse Popular Code Answers by Language