Commit 75780f99 authored by Robert Griesemer's avatar Robert Griesemer

csv: fix spelling errors in comments

Fixes #2066.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4699045
parent 7318664c
...@@ -87,7 +87,7 @@ var ( ...@@ -87,7 +87,7 @@ var (
// 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, if not 0, is the comment character. Lines beginning with the
// Comment character is ignored. // Comment character are ignored.
// //
// If FieldsPerRecord is positive, Read requires each record to // 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
...@@ -97,7 +97,7 @@ var ( ...@@ -97,7 +97,7 @@ var (
// If LazyQuotes is true, a quote may appear in an unquoted field and a // If LazyQuotes is true, a quote may appear in an unquoted field and a
// non-doubled quote may appear in a quoted field. // non-doubled quote may appear in a quoted field.
// //
// If TrailingComma is true, the last field may be a unquoted empty field. // If TrailingComma is true, the last field may be an unquoted empty field.
// //
// If TrimLeadingSpace is true, leading white space in a field is ignored. // If TrimLeadingSpace is true, leading white space in a field is ignored.
type Reader struct { type Reader struct {
...@@ -171,7 +171,7 @@ func (r *Reader) ReadAll() (records [][]string, err os.Error) { ...@@ -171,7 +171,7 @@ func (r *Reader) ReadAll() (records [][]string, err os.Error) {
} }
// readRune reads one rune from r, folding \r\n to \n and keeping track // readRune reads one rune from r, folding \r\n to \n and keeping track
// of our far into the line we have read. r.column will point to the start // of how far into the line we have read. r.column will point to the start
// of this rune, not the end of this rune. // of this rune, not the end of this rune.
func (r *Reader) readRune() (int, os.Error) { func (r *Reader) readRune() (int, os.Error) {
rune, _, err := r.r.ReadRune() rune, _, err := r.r.ReadRune()
...@@ -222,7 +222,7 @@ func (r *Reader) parseRecord() (fields []string, err os.Error) { ...@@ -222,7 +222,7 @@ func (r *Reader) parseRecord() (fields []string, err os.Error) {
// 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 are support comments and it is the comment character // If we are support comments and it is the comment character
// the skip to the end of line. // then skip to the end of line.
rune, _, err := r.r.ReadRune() rune, _, err := r.r.ReadRune()
if err != nil { if err != nil {
...@@ -281,7 +281,7 @@ func (r *Reader) parseField() (haveField bool, delim int, err os.Error) { ...@@ -281,7 +281,7 @@ func (r *Reader) parseField() (haveField bool, delim int, err os.Error) {
// will check below // will check below
case '\n': case '\n':
// We are a trailing empty field or a blank linke // We are a trailing empty field or a blank line
if r.column == 0 { if r.column == 0 {
return false, rune, nil return false, rune, nil
} }
...@@ -352,7 +352,7 @@ func (r *Reader) parseField() (haveField bool, delim int, err os.Error) { ...@@ -352,7 +352,7 @@ func (r *Reader) parseField() (haveField bool, delim int, err os.Error) {
if !r.TrailingComma { if !r.TrailingComma {
// We don't allow trailing commas. See if we // We don't allow trailing commas. See if we
// are at the end of the line (being mindful // are at the end of the line (being mindful
// of triming spaces // of trimming spaces).
c := r.column c := r.column
rune, err = r.readRune() rune, err = r.readRune()
if r.TrimLeadingSpace { if r.TrimLeadingSpace {
......
...@@ -22,7 +22,6 @@ import ( ...@@ -22,7 +22,6 @@ import (
// Comma is the field delimiter. // Comma is the field delimiter.
// //
// If UseCRLF is true, the Writer ends each record with \r\n instead of \n. // If UseCRLF is true, the Writer ends each record with \r\n instead of \n.
// just \n is written.
type Writer struct { type Writer struct {
Comma int // Field delimiter (set to to ',' by NewWriter) Comma int // Field delimiter (set to to ',' by NewWriter)
UseCRLF bool // True to use \r\n as the line terminator UseCRLF bool // True to use \r\n as the line terminator
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment