I have for loop with goroutines. I create the go routines in the loop which prints a string and "i" which is an int. I know the strings and "i" will print in random order which it does. But "i" is not adding correctly as you can see below. The value stays the same for three or four of the five strings then jumps to 2 or 1. Shouldn't there be a 1, 2, 3, 4, 5 in the random order? What am I doing wrong?

package main

import (
    "fmt"
    "sync"
)

func main() {
    a := []string{
        "apple",
        "orange",
        "grape",
        "peach",
        "lemon",
    }

    wg := sync.WaitGroup{}
    wg.Add(len(a))
    i := 0
    for _, v := range a {
        go func(a string) {
            fmt.Println(a, i)
            i++
            wg.Done()
        }(v)
    }
    wg.Wait()
}

Result 1:

orange 0
apple 0
lemon 0
peach 2
grape 0

Result 2:

lemon 0
grape 0
peach 0
apple 0
orange 1

My Goal (random order)

lemon 2
grape 4
peach 1
apple 0
orange 3