Created
May 21, 2015 14:34
-
-
Save Barbery/671201a371735c9abf4b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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