On Wed, Feb 14, 2024 at 12:14 PM 'Dan Kortschak' via golang-nuts
<golang-nuts@googlegroups.com> wrote:

> Given that this can happen without a race or unsafe modifications it
> might be worth filing a issue for.

I think this is expected. Quoting from the big.Int docs
https://pkg.go.dev/math/big#Int

----
To "copy" an Int value, an existing (or newly allocated) Int must be
set to a new value using the Int.Set method; shallow copies of Ints
are not supported and may lead to errors.
----

But OP's 'b := *a' is creating a shallow copy.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAA40n-XGCwJHgqj7nMnkoF_sJcrdA3DsbM8OuVmmPNgqg7ZBXg%40mail.gmail.com.

Reply via email to