Is there a better or more idiomatic way in Go to encode a []byte slice into an int64?
package main import \"fmt\" func main() { var mySlice = []byte{244, 2
You can use encoding/binary's ByteOrder to do this for 16, 32, 64 bit types
Play
package main import "fmt" import "encoding/binary" func main() { var mySlice = []byte{244, 244, 244, 244, 244, 244, 244, 244} data := binary.BigEndian.Uint64(mySlice) fmt.Println(data) }