summaryrefslogtreecommitdiff
path: root/src/pkg/encoding/binary/binary.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/encoding/binary/binary.go')
-rw-r--r--src/pkg/encoding/binary/binary.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pkg/encoding/binary/binary.go b/src/pkg/encoding/binary/binary.go
index a4b390701..a01d0e024 100644
--- a/src/pkg/encoding/binary/binary.go
+++ b/src/pkg/encoding/binary/binary.go
@@ -126,7 +126,7 @@ func (bigEndian) GoString() string { return "binary.BigEndian" }
// and written to successive fields of the data.
func Read(r io.Reader, order ByteOrder, data interface{}) os.Error {
var v reflect.Value
- switch d := reflect.NewValue(data); d.Kind() {
+ switch d := reflect.ValueOf(data); d.Kind() {
case reflect.Ptr:
v = d.Elem()
case reflect.Slice:
@@ -155,7 +155,7 @@ func Read(r io.Reader, order ByteOrder, data interface{}) os.Error {
// Bytes written to w are encoded using the specified byte order
// and read from successive fields of the data.
func Write(w io.Writer, order ByteOrder, data interface{}) os.Error {
- v := reflect.Indirect(reflect.NewValue(data))
+ v := reflect.Indirect(reflect.ValueOf(data))
size := TotalSize(v)
if size < 0 {
return os.NewError("binary.Write: invalid type " + v.Type().String())