summaryrefslogtreecommitdiff
path: root/src/pkg/netchan/export.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/netchan/export.go')
-rw-r--r--src/pkg/netchan/export.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pkg/netchan/export.go b/src/pkg/netchan/export.go
index 2209f04e8..1e5ccdb5c 100644
--- a/src/pkg/netchan/export.go
+++ b/src/pkg/netchan/export.go
@@ -3,7 +3,7 @@
// license that can be found in the LICENSE file.
/*
- The netchan package implements type-safe networked channels:
+ Package netchan implements type-safe networked channels:
it allows the two ends of a channel to appear on different
computers connected by a network. It does this by transporting
data sent to a channel on one machine so it can be recovered
@@ -111,9 +111,9 @@ func (client *expClient) getChan(hdr *header, dir Dir) *netChan {
// data arrives from the client.
func (client *expClient) run() {
hdr := new(header)
- hdrValue := reflect.NewValue(hdr)
+ hdrValue := reflect.ValueOf(hdr)
req := new(request)
- reqValue := reflect.NewValue(req)
+ reqValue := reflect.ValueOf(req)
error := new(error)
for {
*hdr = header{}
@@ -221,7 +221,7 @@ func (client *expClient) serveSend(hdr header) {
return
}
// Create a new value for each received item.
- val := reflect.Zero(nch.ch.Type().Elem())
+ val := reflect.New(nch.ch.Type().Elem()).Elem()
if err := client.decode(val); err != nil {
expLog("value decode:", err, "; type ", nch.ch.Type())
return
@@ -341,7 +341,7 @@ func (exp *Exporter) Sync(timeout int64) os.Error {
}
func checkChan(chT interface{}, dir Dir) (reflect.Value, os.Error) {
- chanType := reflect.Typeof(chT)
+ chanType := reflect.TypeOf(chT)
if chanType.Kind() != reflect.Chan {
return reflect.Value{}, os.ErrorString("not a channel")
}
@@ -359,7 +359,7 @@ func checkChan(chT interface{}, dir Dir) (reflect.Value, os.Error) {
return reflect.Value{}, os.ErrorString("to import/export with Recv, must provide chan<-")
}
}
- return reflect.NewValue(chT), nil
+ return reflect.ValueOf(chT), nil
}
// Export exports a channel of a given type and specified direction. The