1 // Copyright 2013 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package a 6 7 type Package struct { 8 name string 9 } 10 11 type Future struct { 12 result chan struct { 13 *Package 14 error 15 } 16 } 17 18 func (t *Future) Result() (*Package, error) { 19 result := <-t.result 20 t.result <- result 21 return result.Package, result.error 22 } 23