import ( "fmt" "math/big" ) func main() { x := big.NewInt(12345678901234567890) b := x.Bytes() fmt.Printf("%v\n", b) }
[4 162 92 153 115 6 181 142 125 138]
import ( "fmt" "math/big" ) func main() { b := []byte{4, 162, 92, 153, 115, 6, 181, 142, 125, 138} x := new(big.Int).SetBytes(b) fmt.Printf("%v\n", x) }
12345678901234567890In conclusion, these examples use methods from the Go library package "math/big" for performing arithmetic operations on arbitrary-precision integers.