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/encoding/csv/reader.go | 22 +++++++++++----------- src/encoding/csv/writer.go | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src/encoding/csv') diff --git a/src/encoding/csv/reader.go b/src/encoding/csv/reader.go index 816ed26754..58f6eed1e6 100644 --- a/src/encoding/csv/reader.go +++ b/src/encoding/csv/reader.go @@ -14,11 +14,11 @@ // // Carriage returns before newline characters are silently removed. // -// Blank lines are ignored. A line with only whitespace characters (excluding +// Blank lines are ignored. A line with only whitespace characters (excluding // the ending newline character) is not considered a blank line. // // Fields which start and stop with the quote character " are called -// quoted-fields. The beginning and ending quote are not part of the +// quoted-fields. The beginning and ending quote are not part of the // field. // // The source: @@ -84,15 +84,15 @@ var ( // The exported fields can be changed to customize the details before the // first call to Read or ReadAll. // -// Comma is the field delimiter. It defaults to ','. +// Comma is the field delimiter. It defaults to ','. // // Comment, if not 0, is the comment character. Lines beginning with the // Comment character are ignored. // // If FieldsPerRecord is positive, Read requires each record to -// have the given number of fields. If FieldsPerRecord is 0, Read sets it to +// have the given number of fields. If FieldsPerRecord is 0, Read sets it to // the number of fields in the first record, so that future records must -// have the same field count. If FieldsPerRecord is negative, no check is +// have the same field count. If FieldsPerRecord is negative, no check is // made and records may have a variable number of fields. // // If LazyQuotes is true, a quote may appear in an unquoted field and a @@ -131,7 +131,7 @@ func (r *Reader) error(err error) error { } } -// Read reads one record from r. The record is a slice of strings with each +// Read reads one record from r. The record is a slice of strings with each // string representing one field. func (r *Reader) Read() (record []string, err error) { for { @@ -179,7 +179,7 @@ func (r *Reader) ReadAll() (records [][]string, err error) { func (r *Reader) readRune() (rune, error) { r1, _, err := r.r.ReadRune() - // Handle \r\n here. We make the simplifying assumption that + // Handle \r\n here. We make the simplifying assumption that // anytime \r is followed by \n that it can be folded to \n. // We will not detect files which contain both \r\n and bare \n. if r1 == '\r' { @@ -210,13 +210,13 @@ func (r *Reader) skip(delim rune) error { // parseRecord reads and parses a single csv record from r. func (r *Reader) parseRecord() (fields []string, err error) { - // Each record starts on a new line. We increment our line + // Each record starts on a new line. We increment our line // number (lines start at 1, not 0) and set column to -1 // so as we increment in readRune it points to the character we read. r.line++ r.column = -1 - // Peek at the first rune. If it is an error we are done. + // Peek at the first rune. If it is an error we are done. // If we support comments and it is the comment character // then skip to the end of line. @@ -249,8 +249,8 @@ func (r *Reader) parseRecord() (fields []string, err error) { } } -// parseField parses the next field in the record. The read field is -// located in r.field. Delim is the first character not part of the field +// parseField parses the next field in the record. The read field is +// located in r.field. Delim is the first character not part of the field // (r.Comma or '\n'). func (r *Reader) parseField() (haveField bool, delim rune, err error) { r.field.Reset() diff --git a/src/encoding/csv/writer.go b/src/encoding/csv/writer.go index e8739fb554..84b7aa1ed1 100644 --- a/src/encoding/csv/writer.go +++ b/src/encoding/csv/writer.go @@ -15,7 +15,7 @@ import ( // A Writer writes records to a CSV encoded file. // // As returned by NewWriter, a Writer writes records terminated by a -// newline and uses ',' as the field delimiter. The exported fields can be +// newline and uses ',' as the field delimiter. The exported fields can be // changed to customize the details before the first call to Write or WriteAll. // // Comma is the field delimiter. -- cgit v1.3