mirror of
https://github.com/golang/go
synced 2024-11-11 23:10:23 -07:00
49da9a8e44
Update #5910. R=golang-dev, daniel.morsing, rsc CC=golang-dev https://golang.org/cl/11373044
18 lines
213 B
Go
18 lines
213 B
Go
package a
|
|
|
|
type Package struct {
|
|
name string
|
|
}
|
|
|
|
type Future struct {
|
|
result chan struct {
|
|
*Package
|
|
}
|
|
}
|
|
|
|
func (t *Future) Result() *Package {
|
|
result := <-t.result
|
|
t.result <- result
|
|
return result.Package
|
|
}
|