-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed as not planned
Labels
Description
What version of Go are you using (go version)?
$ go version go version go1.20.1 darwin/arm64
What did you do?
// You can edit this code!
// Click here and start typing.
package main
import (
"fmt"
"math/big"
)
type Test struct {
target big.Int
}
func OO(input Test) {
input.target.Add(&input.target, big.NewInt(2))
}
func main() {
var yy Test
yy.target.SetUint64(0)
for i := 0; i < 4; i++ {
OO(yy)
fmt.Println(yy.target.String())
yy.target.Add(&yy.target, big.NewInt(10))
}
fmt.Println(yy.target.String())
}
I What did you expect to see?
I thought the answer was.
0
10
20
30
40
But i got
0
10
22
34
44