]> Cypherpunks repositories - gostls13.git/commitdiff
Fixed documentation for netchan import()
authorAnschel Schaffer-Cohen <anschelsc@gmail.com>
Fri, 21 Jan 2011 03:58:08 +0000 (19:58 -0800)
committerRob Pike <r@golang.org>
Fri, 21 Jan 2011 03:58:08 +0000 (19:58 -0800)
This was broken after the last update (2011-01-20).
However, I'm not sure if the changed example is a
sensible use of import(), so I'd appreciate comments.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4067043

src/pkg/netchan/import.go

index 22b0f69ba383628fbe65f8948bb4fef3fdddc878..a694fb41f6dcbb6a05a457d9658c01ed2b0d3fcb 100644 (file)
@@ -171,12 +171,12 @@ func (imp *Importer) Import(name string, chT interface{}, dir Dir, size int) os.
 // 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
-//     ImportNValues(name string, chT chan T, dir Dir, n int) os.Error
+//     ImportNValues(name string, chT chan T, dir Dir, size, n int) os.Error
 // Example usage:
 //     imp, err := NewImporter("tcp", "netchanserver.mydomain.com:1234")
 //     if err != nil { log.Exit(err) }
 //     ch := make(chan myType)
-//     err = imp.ImportNValues("name", ch, Recv, 1)
+//     err = imp.ImportNValues("name", ch, Recv, 1, 1)
 //     if err != nil { log.Exit(err) }
 //     fmt.Printf("%+v\n", <-ch)
 func (imp *Importer) ImportNValues(name string, chT interface{}, dir Dir, size, n int) os.Error {