mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
netchan: rather than 0, make -1 mean infinite, by analogy with strings.Split etc.
It's unlikely to affect any extant code, but I wanted to make this API change before digging in for a rewrite. R=rsc CC=golang-dev https://golang.org/cl/2112041
This commit is contained in:
parent
426275d702
commit
3d76135ee5
2 changed files with 5 additions and 4 deletions
|
|
@ -114,14 +114,14 @@ func (imp *Importer) run() {
|
|||
}
|
||||
|
||||
// Import imports a channel of the given type and specified direction.
|
||||
// It is equivalent to ImportNValues with a count of 0, meaning unbounded.
|
||||
// It is equivalent to ImportNValues with a count of -1, meaning unbounded.
|
||||
func (imp *Importer) Import(name string, chT interface{}, dir Dir) os.Error {
|
||||
return imp.ImportNValues(name, chT, dir, 0)
|
||||
}
|
||||
|
||||
// ImportNValues imports a channel of the given type and specified direction
|
||||
// and then receives or transmits up to n values on that channel. A value of
|
||||
// n==0 implies an unbounded number of values. The channel to be bound to
|
||||
// n==-1 implies an unbounded number of values. The channel to be bound to
|
||||
// the remote site's channel is provided in the call and may be of arbitrary
|
||||
// channel type.
|
||||
// Despite the literal signature, the effective signature is
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue