mirror of
https://github.com/golang/go
synced 2024-11-26 21:21:34 -07:00
doc/effective_go.html: fix a couple of cosmetic issues
At the moment, godoc expands the example in the link, but in the past it has not. Add a waffle word to allow either possibility. Also change the order of cases in the switch in Compare to be consistent with the other switch in the function. R=golang-dev, iant CC=golang-dev https://golang.org/cl/14439055
This commit is contained in:
parent
b6c0c4228d
commit
beca0e124d
@ -44,8 +44,8 @@ use the language.
|
|||||||
Moreover, many of the packages contain working, self-contained
|
Moreover, many of the packages contain working, self-contained
|
||||||
executable examples you can run directly from the
|
executable examples you can run directly from the
|
||||||
<a href="http://golang.org">golang.org</a> web site, such as
|
<a href="http://golang.org">golang.org</a> web site, such as
|
||||||
<a href="http://golang.org/pkg/strings/#example_Map">this one</a> (click
|
<a href="http://golang.org/pkg/strings/#example_Map">this one</a> (if
|
||||||
on the word "Example" to open it up).
|
necessary, click on the word "Example" to open it up).
|
||||||
If you have a question about how to approach a problem or how something
|
If you have a question about how to approach a problem or how something
|
||||||
might be implemented, the documentation, code and examples in the
|
might be implemented, the documentation, code and examples in the
|
||||||
library can provide answers, ideas and
|
library can provide answers, ideas and
|
||||||
@ -839,10 +839,10 @@ func Compare(a, b []byte) int {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
switch {
|
switch {
|
||||||
case len(a) < len(b):
|
|
||||||
return -1
|
|
||||||
case len(a) > len(b):
|
case len(a) > len(b):
|
||||||
return 1
|
return 1
|
||||||
|
case len(a) < len(b):
|
||||||
|
return -1
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user