package main
import "fmt"
func main(){
a:=[]int{1,2,3,4,5} //slice of int
b:=[]struct{ //another slice of struct
i int
j string
}{
{1,"精"},
{2 ,"コバや歌詞"},
{3,"新一"},
{4,"武士"},
}
c:=[]struct{ //slice of slices
d []struct
e []int
}{
{a[:],b[:]},
}
fmt.Println(a,b,c)
}
The errors are:-
- ./slices.go:16:3: syntax error: unexpected e, expecting {
- ./slices.go:17:3: syntax error: unexpected {, expecting semicolon or newline or }
- ./slices.go:18:7: syntax error: unexpected ] at end of statement