您可以使用encoding.binary包:arr := []byte{0xda, 0xcc, 0xd9, 0x74, 0x24, 0xf4}for i := 0; i < 8 - len(arr); i++ { arr = append([]byte{0x0, 0x0}, arr...) // for not to get index out of range}ptr := binary.BigEndian.Uint64(arr)fmt.Printf("0x%x\n", uintptr(ptr))https://play.golang.org/p/QFUVlIFdLZL