I am new in golang and try to learn with small examples.
So I am trying to create a 2D array and assign a value but I am stuck here can anyone help me. here is my code.
package main
import (
"fmt"
)
func main() {
fmt.Println("Hello, playground")
letters := make([][]string,0,2)
letters[0][0] = "a"
letters[0][1] = "b"
letters[1][0] = "c"
letters[1][1] = "d"
fmt.Println(letters)
}
I am getting error when I run this code
panic: runtime error: index out of range