I create a map like so:
board := make(map[int]map[string]string)
I add some numbers to it so data is formatted like follows.
1 : map("a", "b" ..)
I then pass in a position. "a1" and this is where I hit a wall.
func (checkers *Checkers) setPiece(piece string, coordinates string) {
lett := string(coordinates[0]);
num, err := strconv.ParseInt(string(coordinates[1]), 0, 64)
if err != nil {
panic("Invalid coordinate format")
}
row := checkers.board[num]
}
I get the follow error: 'cannot use num (type int64) as type int in map index'
Why do I get this error? How do I access a key in the map?