Open nileshpatra opened 1 year ago
sample.go
package main import "fmt" func main() { a := []int{} a = append(a, 1) b := []int{} b = append(a, 2, 3) fmt.Println(cap(a)) fmt.Println(cap(b)) fmt.Println(b) }
### On 64 bit 1 3 [1 2 3]
### On 32 bit 2 4 [1 2 3]
0.15.1
On compiling with Go as GOARCH set to 386, the output matches on what I get with yaegi on 32-bit.
$ GOARCH=386 go run sample.go 2 4 [1 2 3]
Since runtime behavior on 32-bit is same, there are two question:
cap
The following program
sample.go
triggers an unexpected resultExpected result
Got
Yaegi Version
0.15.1
Additional Notes
On compiling with Go as GOARCH set to 386, the output matches on what I get with yaegi on 32-bit.
Since runtime behavior on 32-bit is same, there are two question:
cap
is expected then the test here is unreliable and probably should be pruned?