On Wed, 2024-02-14 at 12:24 +0100, Jan Mercl wrote:
> 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 are absolutely right. I looked for this kind of warning, but
obviously not hard enough.

-- 
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/0935c8c90863d3144ea225ea78d233ad89bbdc9b.camel%40kortschak.io.

Reply via email to