Skip to content

Instantly share code, notes, and snippets.

@aflag
Created August 25, 2015 21:48
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 aflag/eb216bfc9e95e0e41a6c to your computer and use it in GitHub Desktop.
Save aflag/eb216bfc9e95e0e41a6c to your computer and use it in GitHub Desktop.
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