summaryrefslogtreecommitdiff
path: root/src/pkg/netchan/import.go
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2010-06-28 15:59:54 -0700
committerRob Pike <r@golang.org>2010-06-28 15:59:54 -0700
commit928d4436de1c2877c388eab4ea83baaa76ce19da (patch)
tree3023bea04a3623a09d881c92953cbd5ee207e328 /src/pkg/netchan/import.go
parent2e258e4d7d5776741079b4b741b9e9dc9e476719 (diff)
downloadgolang-928d4436de1c2877c388eab4ea83baaa76ce19da.tar.gz
netchan: allow chan of basic types now that gob can handle such
R=rsc CC=golang-dev http://codereview.appspot.com/1741041
Diffstat (limited to 'src/pkg/netchan/import.go')
-rw-r--r--src/pkg/netchan/import.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/pkg/netchan/import.go b/src/pkg/netchan/import.go
index 454e265b2..d2fd23473 100644
--- a/src/pkg/netchan/import.go
+++ b/src/pkg/netchan/import.go
@@ -136,7 +136,7 @@ func (imp *Importer) Import(name string, chT interface{}, dir Dir, pT interface{
// err := imp.ImportNValues("name", ch, Recv, new(myType), 1)
// if err != nil { log.Exit(err) }
// fmt.Printf("%+v\n", <-ch)
-// TODO: fix gob interface so we can eliminate the need for pT, and for structs.
+// TODO: fix reflection so we can eliminate the need for pT.
func (imp *Importer) ImportNValues(name string, chT interface{}, dir Dir, pT interface{}, n int) os.Error {
ch, err := checkChan(chT, dir)
if err != nil {
@@ -147,9 +147,6 @@ func (imp *Importer) ImportNValues(name string, chT interface{}, dir Dir, pT int
if _, ok := rt.(*reflect.PtrType); !ok {
return os.ErrorString("not a pointer:" + rt.String())
}
- if _, ok := reflect.Indirect(reflect.NewValue(pT)).(*reflect.StructValue); !ok {
- return os.ErrorString("not a pointer to a struct:" + rt.String())
- }
imp.chanLock.Lock()
defer imp.chanLock.Unlock()
_, present := imp.chans[name]