Skip to content

Commit

Permalink
all: single space after period.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Dave Day <[email protected]>
Run-TryBot: Brad Fitzpatrick <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
  • Loading branch information
bradfitz committed Mar 2, 2016
1 parent 8b4deb4 commit 5fea2cc
Show file tree
Hide file tree
Showing 536 changed files with 1,732 additions and 1,732 deletions.
4 changes: 2 additions & 2 deletions src/archive/tar/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,8 @@ func (tw *Writer) writePAXHeader(hdr *Header, paxHeaders map[string]string) erro
// succeed, and seems harmless enough.
ext.ModTime = hdr.ModTime
// The spec asks that we namespace our pseudo files
// with the current pid. However, this results in differing outputs
// for identical inputs. As such, the constant 0 is now used instead.
// with the current pid. However, this results in differing outputs
// for identical inputs. As such, the constant 0 is now used instead.
// golang.org/issue/12358
dir, file := path.Split(hdr.Name)
fullName := path.Join(dir, "PaxHeaders.0", file)
Expand Down
4 changes: 2 additions & 2 deletions src/bufio/bufio.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func (b *Reader) ReadByte() (byte, error) {
return c, nil
}

// UnreadByte unreads the last byte. Only the most recently read byte can be unread.
// UnreadByte unreads the last byte. Only the most recently read byte can be unread.
func (b *Reader) UnreadByte() error {
if b.lastByte < 0 || b.r == 0 && b.w > 0 {
return ErrInvalidUnreadByte
Expand Down Expand Up @@ -273,7 +273,7 @@ func (b *Reader) ReadRune() (r rune, size int, err error) {
return r, size, nil
}

// UnreadRune unreads the last rune. If the most recent read operation on
// UnreadRune unreads the last rune. If the most recent read operation on
// the buffer was not a ReadRune, UnreadRune returns an error. (In this
// regard it is stricter than UnreadByte, which will unread the last byte
// from any read operation.)
Expand Down
10 changes: 5 additions & 5 deletions src/bytes/buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var ErrTooLarge = errors.New("bytes.Buffer: too large")
func (b *Buffer) Bytes() []byte { return b.buf[b.off:] }

// String returns the contents of the unread portion of the buffer
// as a string. If the Buffer is a nil pointer, it returns "<nil>".
// as a string. If the Buffer is a nil pointer, it returns "<nil>".
func (b *Buffer) String() string {
if b == nil {
// Special case, useful in debugging.
Expand Down Expand Up @@ -145,7 +145,7 @@ func (b *Buffer) WriteString(s string) (n int, err error) {
}

// MinRead is the minimum slice size passed to a Read call by
// Buffer.ReadFrom. As long as the Buffer has at least MinRead bytes beyond
// Buffer.ReadFrom. As long as the Buffer has at least MinRead bytes beyond
// what is required to hold the contents of r, ReadFrom will not grow the
// underlying buffer.
const MinRead = 512
Expand Down Expand Up @@ -252,7 +252,7 @@ func (b *Buffer) WriteRune(r rune) (n int, err error) {
}

// Read reads the next len(p) bytes from the buffer or until the buffer
// is drained. The return value n is the number of bytes read. If the
// is drained. The return value n is the number of bytes read. If the
// buffer has no data to return, err is io.EOF (unless len(p) is zero);
// otherwise it is nil.
func (b *Buffer) Read(p []byte) (n int, err error) {
Expand Down Expand Up @@ -347,7 +347,7 @@ func (b *Buffer) UnreadRune() error {
}

// UnreadByte unreads the last byte returned by the most recent
// read operation. If write has happened since the last read, UnreadByte
// read operation. If write has happened since the last read, UnreadByte
// returns an error.
func (b *Buffer) UnreadByte() error {
if b.lastRead != opReadRune && b.lastRead != opRead {
Expand Down Expand Up @@ -400,7 +400,7 @@ func (b *Buffer) ReadString(delim byte) (line string, err error) {
}

// NewBuffer creates and initializes a new Buffer using buf as its initial
// contents. It is intended to prepare a Buffer to read existing data. It
// contents. It is intended to prepare a Buffer to read existing data. It
// can also be used to size the internal buffer for writing. To do that,
// buf should have the desired capacity but a length of zero.
//
Expand Down
18 changes: 9 additions & 9 deletions src/bytes/bytes.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func IndexRune(s []byte, r rune) int {

// IndexAny interprets s as a sequence of UTF-8-encoded Unicode code points.
// It returns the byte index of the first occurrence in s of any of the Unicode
// code points in chars. It returns -1 if chars is empty or if there is no code
// code points in chars. It returns -1 if chars is empty or if there is no code
// point in common.
func IndexAny(s []byte, chars string) int {
if len(chars) > 0 {
Expand All @@ -188,8 +188,8 @@ func IndexAny(s []byte, chars string) int {
}

// LastIndexAny interprets s as a sequence of UTF-8-encoded Unicode code
// points. It returns the byte index of the last occurrence in s of any of
// the Unicode code points in chars. It returns -1 if chars is empty or if
// points. It returns the byte index of the last occurrence in s of any of
// the Unicode code points in chars. It returns -1 if chars is empty or if
// there is no code point in common.
func LastIndexAny(s []byte, chars string) int {
if len(chars) > 0 {
Expand Down Expand Up @@ -276,7 +276,7 @@ func Fields(s []byte) [][]byte {

// FieldsFunc interprets s as a sequence of UTF-8-encoded Unicode code points.
// It splits the slice s at each run of code points c satisfying f(c) and
// returns a slice of subslices of s. If all code points in s satisfy f(c), or
// returns a slice of subslices of s. If all code points in s satisfy f(c), or
// len(s) == 0, an empty slice is returned.
// FieldsFunc makes no guarantees about the order in which it calls f(c).
// If f does not return consistent results for a given c, FieldsFunc may crash.
Expand Down Expand Up @@ -352,12 +352,12 @@ func HasSuffix(s, suffix []byte) bool {

// Map returns a copy of the byte slice s with all its characters modified
// according to the mapping function. If mapping returns a negative value, the character is
// dropped from the string with no replacement. The characters in s and the
// dropped from the string with no replacement. The characters in s and the
// output are interpreted as UTF-8-encoded Unicode code points.
func Map(mapping func(r rune) rune, s []byte) []byte {
// In the worst case, the slice 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
b := make([]byte, maxbytes)
Expand Down Expand Up @@ -697,7 +697,7 @@ func EqualFold(s, t []byte) 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 {
Expand All @@ -709,6 +709,6 @@ func EqualFold(s, t []byte) bool {
return false
}

// One string is empty. Are both?
// One string is empty. Are both?
return len(s) == len(t)
}
4 changes: 2 additions & 2 deletions src/bytes/bytes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func TestEqualExhaustive(t *testing.T) {
}
}

// make sure Equal returns false for minimally different strings. The data
// make sure Equal returns false for minimally different strings. The data
// is all zeros except for a single one in one location.
func TestNotEqual(t *testing.T) {
var size = 128
Expand Down Expand Up @@ -797,7 +797,7 @@ 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(r rune) rune { return unicode.MaxRune }
m := Map(maxRune, []byte(a))
expect := tenRunes(unicode.MaxRune)
Expand Down
2 changes: 1 addition & 1 deletion src/bytes/compare_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func TestCompareBytes(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)
Expand Down
4 changes: 2 additions & 2 deletions src/bytes/equal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import (
)

// This file tests the situation where memeq is checking
// data very near to a page boundary. We want to make sure
// data very near to a page boundary. We want to make sure
// equal does not read across the boundary and cause a page
// fault where it shouldn't.

// This test runs only on linux. The code being tested is
// This test runs only on linux. The code being tested is
// not OS-specific, so it does not need to be tested on all
// operating systems.

Expand Down
2 changes: 1 addition & 1 deletion src/cmd/cgo/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func sourceLine(n ast.Node) int {
}

// ReadGo populates f with information learned from reading the
// Go source file with the given file name. It gathers the C preamble
// Go source file with the given file name. It gathers the C preamble
// attached to the import "C" comment, a list of references to C.xxx,
// a list of exported functions, and the actual AST, to be rewritten and
// printed.
Expand Down
Loading

0 comments on commit 5fea2cc

Please sign in to comment.