go2v
go2v copied to clipboard
Problem with initialize array.
Go code:
package main
import "fmt"
func main() {
matrix := [][]int{
{1, 2, 3},
{4, 5, 6},
{7, 8, 9},
}
fmt.Printf("%v\n", matrix)
}
go2v translates this as
module main
fn main() {mut matrix:=[[{1 ,2 ,3 } ,[{4 ,5 ,6 } ,[{7 ,8 ,9 } ]
strconv.v_printf("%v\n" ,matrix ,)
}
which of course, can't be formatted.
The first problem is the array. It should've been translated to
mut matrix:=[[1, 2, 3], [4, 5, 6], [7, 8, 9]]
There are other problems, but this issue is about the matrix being translated incorrectly.