1
0
mirror of https://github.com/golang/go synced 2024-10-04 12:21:26 -06:00
go/src/pkg/bytes
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
..
asm_386.s bytes: faster Count, Index, Equal 2011-12-07 15:09:56 -05:00
asm_amd64.s bytes: lost edit from earlier CL 2011-12-07 15:30:01 -05:00
asm_arm.s bytes: faster Count, Index, Equal 2011-12-07 15:09:56 -05:00
buffer_test.go bytes: delete the test for huge buffers 2012-01-22 09:25:47 -08:00
buffer.go bytes.Buffer: return error in WriteTo if buffer is not drained 2012-02-09 08:58:40 +11:00
bytes_decl.go big, bytes: move assembly externs to separate file 2010-06-21 19:53:08 -07:00
bytes_test.go panics: use the new facilities of testing.B instead 2011-12-20 10:36:25 -08:00
bytes.go update tree for new default type rule 2011-12-08 22:08:03 -05:00
example_test.go godoc: make example code more readable with new comment convention 2012-02-16 11:50:28 +11:00
export_test.go bytes: faster Count, Index, Equal 2011-12-07 15:09:56 -05:00
reader_test.go bytes,strings: make *Reader implement io.ReaderAt 2012-02-15 12:58:00 +11:00
reader.go bytes,strings: make *Reader implement io.ReaderAt 2012-02-15 12:58:00 +11:00