1
0
mirror of https://github.com/golang/go synced 2024-10-04 01:31:25 -06:00
go/src/pkg/container
Andrew Gerrand 11e113db57 godoc: make example code more readable with new comment convention
go/doc: move Examples to go/ast
cmd/go: use go/doc to read examples
src/pkg: update examples to use new convention

This is to make whole file examples more readable. When presented as a
complete function, preceding an Example with its output is confusing.
The new convention is to put the expected output in the final comment
of the example, preceded by the string "output:" (case insensitive).

An idiomatic example looks like this:

// This example demonstrates Foo by doing bar and quux.
func ExampleFoo() {
        // example body that does bar and quux

        // Output:
        // example output
}

R=rsc, gri
CC=golang-dev
https://golang.org/cl/5673053
2012-02-16 11:50:28 +11:00
..
heap godoc: make example code more readable with new comment convention 2012-02-16 11:50:28 +11:00
list build: remove Make.pkg, Make.tool 2012-01-30 23:43:46 -05:00
ring build: remove Make.pkg, Make.tool 2012-01-30 23:43:46 -05:00