mirror of
https://github.com/crazybber/awesome-patterns.git
synced 2025-04-11 13:00:55 +00:00
23 lines
236 B
Go
23 lines
236 B
Go
package main
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/davecgh/go-spew/spew"
|
|
)
|
|
|
|
func main() {
|
|
a := make(chan string)
|
|
go func() {
|
|
time.Sleep(time.Second * 2)
|
|
test := "string"
|
|
a <- test
|
|
}()
|
|
|
|
select {
|
|
case t := <-a:
|
|
spew.Dump(t)
|
|
|
|
}
|
|
|
|
}
|