diff options
| author | Ondřej Surý <ondrej@sury.org> | 2011-04-28 10:35:15 +0200 | 
|---|---|---|
| committer | Ondřej Surý <ondrej@sury.org> | 2011-04-28 10:35:15 +0200 | 
| commit | c1ba1a0fec4aed430709030f98a3bdb90bfeea16 (patch) | |
| tree | 3df18657e50a0313ed6defcda30e4474cb28a467 /src/pkg/testing/script/script.go | |
| parent | 7b15ed9ef455b6b66c6b376898a88aef5d6a9970 (diff) | |
| download | golang-c1ba1a0fec4aed430709030f98a3bdb90bfeea16.tar.gz | |
Imported Upstream version 2011.04.27upstream/2011.04.27
Diffstat (limited to 'src/pkg/testing/script/script.go')
| -rw-r--r-- | src/pkg/testing/script/script.go | 14 | 
1 files changed, 7 insertions, 7 deletions
| diff --git a/src/pkg/testing/script/script.go b/src/pkg/testing/script/script.go index b18018497..afb286f5b 100644 --- a/src/pkg/testing/script/script.go +++ b/src/pkg/testing/script/script.go @@ -2,7 +2,7 @@  // Use of this source code is governed by a BSD-style  // license that can be found in the LICENSE file. -// This package aids in the testing of code that uses channels. +// Package script aids in the testing of code that uses channels.  package script  import ( @@ -134,19 +134,19 @@ type empty struct {  }  func newEmptyInterface(e empty) reflect.Value { -	return reflect.NewValue(e).Field(0) +	return reflect.ValueOf(e).Field(0)  }  func (s Send) send() {  	// With reflect.ChanValue.Send, we must match the types exactly. So, if  	// s.Channel is a chan interface{} we convert s.Value to an interface{}  	// first. -	c := reflect.NewValue(s.Channel) +	c := reflect.ValueOf(s.Channel)  	var v reflect.Value  	if iface := c.Type().Elem(); iface.Kind() == reflect.Interface && iface.NumMethod() == 0 {  		v = newEmptyInterface(empty{s.Value})  	} else { -		v = reflect.NewValue(s.Value) +		v = reflect.ValueOf(s.Value)  	}  	c.Send(v)  } @@ -162,7 +162,7 @@ func (s Close) getSend() sendAction { return s }  func (s Close) getChannel() interface{} { return s.Channel } -func (s Close) send() { reflect.NewValue(s.Channel).Close() } +func (s Close) send() { reflect.ValueOf(s.Channel).Close() }  // A ReceivedUnexpected error results if no active Events match a value  // received from a channel. @@ -278,7 +278,7 @@ func getChannels(events []*Event) ([]interface{}, os.Error) {  			continue  		}  		c := event.action.getChannel() -		if reflect.NewValue(c).Kind() != reflect.Chan { +		if reflect.ValueOf(c).Kind() != reflect.Chan {  			return nil, SetupError("one of the channel values is not a channel")  		} @@ -303,7 +303,7 @@ func getChannels(events []*Event) ([]interface{}, os.Error) {  // channel repeatedly, wrapping them up as either a channelRecv or  // channelClosed structure, and forwards them to the multiplex channel.  func recvValues(multiplex chan<- interface{}, channel interface{}) { -	c := reflect.NewValue(channel) +	c := reflect.ValueOf(channel)  	for {  		v, ok := c.Recv() | 
