traefik / yaegi

Yaegi is Another Elegant Go Interpreter

Home Page:https://pkg.go.dev/github.com/traefik/yaegi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

append slice of slices not working correctly

brucengdev opened this issue · comments

The following program sample.go triggers an unexpected result

package main

import (
	"encoding/json"
	"fmt"
)

func main() {
	arr := make([]interface{}, 0)
	arr = append(arr, []interface{}{1, 2, 3})
	arr = append(arr, []interface{}{5, 6, 7})
	bytes, _ := json.Marshal(arr)
	fmt.Println("array: " + string(bytes))
}

Expected result

$ go run ./sample.go
array: [[1,2,3],[5,6,7]]

Got

$ yaegi ./sample.go
array: [1,2,3,5,6,7]

Yaegi Version

v0.10.0

Additional Notes

No response