From 7fd29cb024126de10a90c54427e050e7928c54b4 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 9 Mar 2020 23:23:49 -0400 Subject: content: make spacing consistent + remove comments Remove repeated blank lines, trailing spaces, trailing blank lines Remove comments from survey2018.article (only article using them). Remove blank lines between successive ".commands". For golang/go#33955. Change-Id: I90cae37a859a8e39549520569d5f10bc455415d3 Reviewed-on: https://go-review.googlesource.com/c/blog/+/222841 Reviewed-by: Ian Lance Taylor --- content/examples.article | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'content/examples.article') diff --git a/content/examples.article b/content/examples.article index a8d5aba..dc24423 100644 --- a/content/examples.article +++ b/content/examples.article @@ -107,10 +107,9 @@ then the example function is compiled but not executed: ok github.com/golang/example/stringutil 0.009s Examples without output comments are useful for demonstrating code that cannot -run as unit tests, such as that which accesses the network, +run as unit tests, such as that which accesses the network, while guaranteeing the example at least compiles. - * Example function names Godoc uses a naming convention to associate an example function with a @@ -131,13 +130,12 @@ Each of these examples documents the `Reverse` function: func ExampleReverse_second() func ExampleReverse_third() - * Larger examples Sometimes we need more than just a function to write a good example. For instance, to demonstrate the [[https://golang.org/pkg/sort/][`sort` package]] -we should show an implementation of `sort.Interface`. +we should show an implementation of `sort.Interface`. Since methods cannot be declared inside a function body, the example must include some context in addition to the example function. -- cgit v1.2.3