Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
6e762987
Commit
6e762987
authored
Aug 19, 2010
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fmt: add sentence about return values to docs for Printf etc.
R=rsc, gri CC=golang-dev
https://golang.org/cl/1952045
parent
c80746aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
src/pkg/fmt/print.go
src/pkg/fmt/print.go
+9
-0
No files found.
src/pkg/fmt/print.go
View file @
6e762987
...
@@ -132,6 +132,7 @@ func (p *pp) Write(b []byte) (ret int, err os.Error) {
...
@@ -132,6 +132,7 @@ func (p *pp) Write(b []byte) (ret int, err os.Error) {
// These routines end in 'f' and take a format string.
// These routines end in 'f' and take a format string.
// 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.
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
,
error
os
.
Error
)
{
p
:=
newPrinter
()
p
:=
newPrinter
()
p
.
doPrintf
(
format
,
a
)
p
.
doPrintf
(
format
,
a
)
...
@@ -141,12 +142,14 @@ func Fprintf(w io.Writer, format string, a ...interface{}) (n int, error os.Erro
...
@@ -141,12 +142,14 @@ func Fprintf(w io.Writer, format string, a ...interface{}) (n int, error os.Erro
}
}
// 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.
func
Printf
(
format
string
,
a
...
interface
{})
(
n
int
,
errno
os
.
Error
)
{
func
Printf
(
format
string
,
a
...
interface
{})
(
n
int
,
errno
os
.
Error
)
{
n
,
errno
=
Fprintf
(
os
.
Stdout
,
format
,
a
)
n
,
errno
=
Fprintf
(
os
.
Stdout
,
format
,
a
)
return
n
,
errno
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.
// It returns the number of bytes written.
func
Sprintf
(
format
string
,
a
...
interface
{})
string
{
func
Sprintf
(
format
string
,
a
...
interface
{})
string
{
p
:=
newPrinter
()
p
:=
newPrinter
()
p
.
doPrintf
(
format
,
a
)
p
.
doPrintf
(
format
,
a
)
...
@@ -159,6 +162,7 @@ func Sprintf(format string, a ...interface{}) string {
...
@@ -159,6 +162,7 @@ func Sprintf(format string, a ...interface{}) string {
// 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.
func
Fprint
(
w
io
.
Writer
,
a
...
interface
{})
(
n
int
,
error
os
.
Error
)
{
func
Fprint
(
w
io
.
Writer
,
a
...
interface
{})
(
n
int
,
error
os
.
Error
)
{
p
:=
newPrinter
()
p
:=
newPrinter
()
p
.
doPrint
(
a
,
false
,
false
)
p
.
doPrint
(
a
,
false
,
false
)
...
@@ -169,6 +173,7 @@ func Fprint(w io.Writer, a ...interface{}) (n int, error os.Error) {
...
@@ -169,6 +173,7 @@ func Fprint(w io.Writer, a ...interface{}) (n int, error os.Error) {
// 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.
func
Print
(
a
...
interface
{})
(
n
int
,
errno
os
.
Error
)
{
func
Print
(
a
...
interface
{})
(
n
int
,
errno
os
.
Error
)
{
n
,
errno
=
Fprint
(
os
.
Stdout
,
a
)
n
,
errno
=
Fprint
(
os
.
Stdout
,
a
)
return
n
,
errno
return
n
,
errno
...
@@ -176,6 +181,7 @@ func Print(a ...interface{}) (n int, errno os.Error) {
...
@@ -176,6 +181,7 @@ func Print(a ...interface{}) (n int, errno os.Error) {
// 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.
// 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.
func
Sprint
(
a
...
interface
{})
string
{
func
Sprint
(
a
...
interface
{})
string
{
p
:=
newPrinter
()
p
:=
newPrinter
()
p
.
doPrint
(
a
,
false
,
false
)
p
.
doPrint
(
a
,
false
,
false
)
...
@@ -190,6 +196,7 @@ func Sprint(a ...interface{}) string {
...
@@ -190,6 +196,7 @@ 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.
func
Fprintln
(
w
io
.
Writer
,
a
...
interface
{})
(
n
int
,
error
os
.
Error
)
{
func
Fprintln
(
w
io
.
Writer
,
a
...
interface
{})
(
n
int
,
error
os
.
Error
)
{
p
:=
newPrinter
()
p
:=
newPrinter
()
p
.
doPrint
(
a
,
true
,
true
)
p
.
doPrint
(
a
,
true
,
true
)
...
@@ -200,6 +207,7 @@ func Fprintln(w io.Writer, a ...interface{}) (n int, error os.Error) {
...
@@ -200,6 +207,7 @@ func Fprintln(w io.Writer, a ...interface{}) (n int, error os.Error) {
// 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.
func
Println
(
a
...
interface
{})
(
n
int
,
errno
os
.
Error
)
{
func
Println
(
a
...
interface
{})
(
n
int
,
errno
os
.
Error
)
{
n
,
errno
=
Fprintln
(
os
.
Stdout
,
a
)
n
,
errno
=
Fprintln
(
os
.
Stdout
,
a
)
return
n
,
errno
return
n
,
errno
...
@@ -207,6 +215,7 @@ func Println(a ...interface{}) (n int, errno os.Error) {
...
@@ -207,6 +215,7 @@ func Println(a ...interface{}) (n int, errno os.Error) {
// 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.
// 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.
func
Sprintln
(
a
...
interface
{})
string
{
func
Sprintln
(
a
...
interface
{})
string
{
p
:=
newPrinter
()
p
:=
newPrinter
()
p
.
doPrint
(
a
,
true
,
true
)
p
.
doPrint
(
a
,
true
,
true
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment