From 5fea2ccc77eb50a9704fa04b7c61755fe34e1d95 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Tue, 1 Mar 2016 23:21:55 +0000 Subject: all: single space after period. The tree's pretty inconsistent about single space vs double space after a period in documentation. Make it consistently a single space, per earlier decisions. This means contributors won't be confused by misleading precedence. This CL doesn't use go/doc to parse. It only addresses // comments. It was generated with: $ perl -i -npe 's,^(\s*// .+[a-z]\.) +([A-Z]),$1 $2,' $(git grep -l -E '^\s*//(.+\.) +([A-Z])') $ go test go/doc -update Change-Id: Iccdb99c37c797ef1f804a94b22ba5ee4b500c4f7 Reviewed-on: https://go-review.googlesource.com/20022 Reviewed-by: Rob Pike Reviewed-by: Dave Day Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/strings/compare_test.go | 2 +- src/strings/strings.go | 10 +++++----- src/strings/strings_test.go | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/strings') diff --git a/src/strings/compare_test.go b/src/strings/compare_test.go index 68fc88e143..bc12e421b0 100644 --- a/src/strings/compare_test.go +++ b/src/strings/compare_test.go @@ -56,7 +56,7 @@ func TestCompareStrings(t *testing.T) { a := make([]byte, n+1) b := make([]byte, n+1) for len := 0; len < 128; len++ { - // randomish but deterministic data. No 0 or 255. + // randomish but deterministic data. No 0 or 255. for i := 0; i < len; i++ { a[i] = byte(1 + 31*i%254) b[i] = byte(1 + 31*i%254) diff --git a/src/strings/strings.go b/src/strings/strings.go index 37d5647ffd..c24c77b9dd 100644 --- a/src/strings/strings.go +++ b/src/strings/strings.go @@ -346,7 +346,7 @@ func FieldsFunc(s string, f func(rune) bool) []string { return a } -// Join concatenates the elements of a to create a single string. The separator string +// Join concatenates the elements of a to create a single string. The separator string // sep is placed between elements in the resulting string. func Join(a []string, sep string) string { if len(a) == 0 { @@ -384,8 +384,8 @@ func HasSuffix(s, suffix string) bool { // dropped from the string with no replacement. func Map(mapping func(rune) rune, s string) string { // In the worst case, the string can grow when mapped, making - // things unpleasant. But it's so rare we barge in assuming it's - // fine. It could also shrink but that falls out naturally. + // things unpleasant. But it's so rare we barge in assuming it's + // fine. It could also shrink but that falls out naturally. maxbytes := len(s) // length of b nbytes := 0 // number of bytes encoded in b // The output buffer b is initialized on demand, the first @@ -714,7 +714,7 @@ func EqualFold(s, t string) bool { return false } - // General case. SimpleFold(x) returns the next equivalent rune > x + // General case. SimpleFold(x) returns the next equivalent rune > x // or wraps around to smaller values. r := unicode.SimpleFold(sr) for r != sr && r < tr { @@ -726,6 +726,6 @@ func EqualFold(s, t string) bool { return false } - // One string is empty. Are both? + // One string is empty. Are both? return s == t } diff --git a/src/strings/strings_test.go b/src/strings/strings_test.go index 49f55fe38c..0572adbdd9 100644 --- a/src/strings/strings_test.go +++ b/src/strings/strings_test.go @@ -492,7 +492,7 @@ func rot13(r rune) rune { func TestMap(t *testing.T) { // Run a couple of awful growth/shrinkage tests a := tenRunes('a') - // 1. Grow. This triggers two reallocations in Map. + // 1. Grow. This triggers two reallocations in Map. maxRune := func(rune) rune { return unicode.MaxRune } m := Map(maxRune, a) expect := tenRunes(unicode.MaxRune) -- cgit v1.3-5-g9baa