Skip to content

Instantly share code, notes, and snippets.

@Barbery
Created May 21, 2015 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Barbery/671201a371735c9abf4b to your computer and use it in GitHub Desktop.
Save Barbery/671201a371735c9abf4b to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"time"
)
func main() {
data := testMap2()
testMap(data)
time.Sleep(3 * time.Second)
fmt.Println(data)
}
func testMap(data map[string]string) {
data["xxx222"] = "xxx"
}
func testMap2() map[string]string {
data := map[string]string{"xxx":"123"}
go func(){
data["xxx333"] = "xxx"
}()
return data
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment