-
Andrew Gerrand authored
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
11e113db
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
testdata | ||
bench_test.go | ||
decode.go | ||
decode_test.go | ||
encode.go | ||
encode_test.go | ||
example_test.go | ||
indent.go | ||
scanner.go | ||
scanner_test.go | ||
stream.go | ||
stream_test.go | ||
tagkey_test.go | ||
tags.go | ||
tags_test.go |