Created
August 25, 2015 21:48
-
-
Save aflag/eb216bfc9e95e0e41a6c to your computer and use it in GitHub Desktop.
This file contains 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" | |
) | |
type field struct { | |
name string | |
} | |
func (p *field) print() { | |
fmt.Println(p.name) | |
} | |
func main() { | |
data := []*field{{"one"},{"two"},{"three"}} | |
for _,v := range data { | |
go v.print() | |
} | |
time.Sleep(3 * time.Second) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment