去候车团没有明显的行为[重复]

I don't understand why this code returns

three three three

package main

import (
    "fmt"
    "sync"
)

func main() {
    wg := sync.WaitGroup{}
    data := []string{"one", "two", "three"}
    for _, v := range data {
        wg.Add(1)
        go func() {
            fmt.Println(v)
            wg.Done()
        }()
    }
    wg.Wait()
}

Please explain anybody

</div>

Add v := v as first line within the loop.

Reference:

This is because each iteration of the loop uses the same instance of the variable v[...]