1
0
mirror of https://github.com/golang/go synced 2024-10-05 00:21:21 -06:00
go/src/pkg/strings
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
..
example_test.go godoc: make example code more readable with new comment convention 2012-02-16 11:50:28 +11:00
export_test.go strings: implement a faster byte->byte Replacer 2011-10-03 13:12:01 -07: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
replace_test.go bytes, strings: use rune 2011-10-25 22:22:09 -07:00
replace.go src/pkg/[n-z]*: gofix -r error -force=error 2011-11-01 22:05:34 -04:00
strings_test.go panics: use the new facilities of testing.B instead 2011-12-20 10:36:25 -08:00
strings.go update tree for new default type rule 2011-12-08 22:08:03 -05:00