1
0
mirror of https://github.com/golang/go synced 2024-11-19 15:54:46 -07:00

fmt: rename errno and error to err for doc consistency

The public godoc looked confused. I imagine these were
written before current conventions were established.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4662060
This commit is contained in:
Brad Fitzpatrick 2011-06-28 11:00:31 -07:00
parent a026d0fc76
commit 39acba55ee

View File

@ -162,19 +162,18 @@ func (p *pp) Write(b []byte) (ret int, err os.Error) {
// Fprintf formats according to a format specifier and writes to w. // Fprintf formats according to a format specifier and writes to w.
// It returns the number of bytes written and any write error encountered. // It returns the number of bytes written and any write error encountered.
func Fprintf(w io.Writer, format string, a ...interface{}) (n int, error os.Error) { func Fprintf(w io.Writer, format string, a ...interface{}) (n int, err os.Error) {
p := newPrinter() p := newPrinter()
p.doPrintf(format, a) p.doPrintf(format, a)
n64, error := p.buf.WriteTo(w) n64, err := p.buf.WriteTo(w)
p.free() p.free()
return int(n64), error return int(n64), err
} }
// Printf formats according to a format specifier and writes to standard output. // Printf formats according to a format specifier and writes to standard output.
// It returns the number of bytes written and any write error encountered. // It returns the number of bytes written and any write error encountered.
func Printf(format string, a ...interface{}) (n int, errno os.Error) { func Printf(format string, a ...interface{}) (n int, err os.Error) {
n, errno = Fprintf(os.Stdout, format, a...) return Fprintf(os.Stdout, format, a...)
return n, errno
} }
// Sprintf formats according to a format specifier and returns the resulting string. // Sprintf formats according to a format specifier and returns the resulting string.
@ -197,20 +196,19 @@ func Errorf(format string, a ...interface{}) os.Error {
// Fprint formats using the default formats for its operands and writes to w. // Fprint formats using the default formats for its operands and writes to w.
// Spaces are added between operands when neither is a string. // Spaces are added between operands when neither is a string.
// It returns the number of bytes written and any write error encountered. // It returns the number of bytes written and any write error encountered.
func Fprint(w io.Writer, a ...interface{}) (n int, error os.Error) { func Fprint(w io.Writer, a ...interface{}) (n int, err os.Error) {
p := newPrinter() p := newPrinter()
p.doPrint(a, false, false) p.doPrint(a, false, false)
n64, error := p.buf.WriteTo(w) n64, err := p.buf.WriteTo(w)
p.free() p.free()
return int(n64), error return int(n64), err
} }
// Print formats using the default formats for its operands and writes to standard output. // Print formats using the default formats for its operands and writes to standard output.
// Spaces are added between operands when neither is a string. // Spaces are added between operands when neither is a string.
// It returns the number of bytes written and any write error encountered. // It returns the number of bytes written and any write error encountered.
func Print(a ...interface{}) (n int, errno os.Error) { func Print(a ...interface{}) (n int, err os.Error) {
n, errno = Fprint(os.Stdout, a...) return Fprint(os.Stdout, a...)
return n, errno
} }
// Sprint formats using the default formats for its operands and returns the resulting string. // Sprint formats using the default formats for its operands and returns the resulting string.
@ -230,20 +228,19 @@ func Sprint(a ...interface{}) string {
// Fprintln formats using the default formats for its operands and writes to w. // Fprintln formats using the default formats for its operands and writes to w.
// Spaces are always added between operands and a newline is appended. // Spaces are always added between operands and a newline is appended.
// It returns the number of bytes written and any write error encountered. // It returns the number of bytes written and any write error encountered.
func Fprintln(w io.Writer, a ...interface{}) (n int, error os.Error) { func Fprintln(w io.Writer, a ...interface{}) (n int, err os.Error) {
p := newPrinter() p := newPrinter()
p.doPrint(a, true, true) p.doPrint(a, true, true)
n64, error := p.buf.WriteTo(w) n64, err := p.buf.WriteTo(w)
p.free() p.free()
return int(n64), error return int(n64), err
} }
// Println formats using the default formats for its operands and writes to standard output. // Println formats using the default formats for its operands and writes to standard output.
// Spaces are always added between operands and a newline is appended. // Spaces are always added between operands and a newline is appended.
// It returns the number of bytes written and any write error encountered. // It returns the number of bytes written and any write error encountered.
func Println(a ...interface{}) (n int, errno os.Error) { func Println(a ...interface{}) (n int, err os.Error) {
n, errno = Fprintln(os.Stdout, a...) return Fprintln(os.Stdout, a...)
return n, errno
} }
// Sprintln formats using the default formats for its operands and returns the resulting string. // Sprintln formats using the default formats for its operands and returns the resulting string.