You could be more concise.
package main
import ( "bytes" "fmt" "encoding/binary")
func main() { var n int64
b := [8]byte{1, 2} buf := bytes.NewBuffer(&b) binary.Read(buf, binary.LittleEndian, &n) fmt.Println(n, b)}
Peter
-Daniel