Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
7ee6d44e
Commit
7ee6d44e
authored
May 27, 2010
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fmt.Scan: custom formatters
R=rsc CC=golang-dev
https://golang.org/cl/1315042
parent
6965b407
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
scan.go
src/pkg/fmt/scan.go
+11
-11
No files found.
src/pkg/fmt/scan.go
View file @
7ee6d44e
...
...
@@ -181,11 +181,11 @@ func (s *ss) token() string {
return
s
.
buf
.
String
()
}
// Scan parses text read from r, storing successive space-separated
//
values into successive arguments. Newlines count as space. Each
//
argument must be a pointer to a basic type. It returns the number of
// i
tems successfully parsed. If that is less than the number of arguments,
// err will report why.
// Scan parses text read from r, storing successive space-separated
values
//
into successive arguments. Newlines count as space. Each argument must
//
be a pointer to a basic type or an implementation of the Scanner
// i
nterface. It returns the number of items successfully parsed. If that
//
is less than the number of arguments,
err will report why.
func
Scan
(
r
io
.
Reader
,
a
...
interface
{})
(
n
int
,
err
os
.
Error
)
{
s
:=
newScanState
(
r
,
true
)
n
=
s
.
doScan
(
a
)
...
...
@@ -194,12 +194,12 @@ func Scan(r io.Reader, a ...interface{}) (n int, err os.Error) {
return
}
// Scanln parses text read from r, storing successive space-separated
//
values into successive arguments. Scanning stops at a newline and after
//
the
final item there must be a newline or EOF. Each argument must be a
// pointer to a basic type
. It returns the number of items successfully
//
parsed. If that is less than the number of arguments, err will report
// why.
// Scanln parses text read from r, storing successive space-separated
values
//
into successive arguments. Scanning stops at a newline and after the
// final item there must be a newline or EOF. Each argument must be a
// pointer to a basic type
or an implementation of the Scanner interface. It
//
returns the number of items successfully parsed. If that is less than the
//
number of arguments, err will report
why.
func
Scanln
(
r
io
.
Reader
,
a
...
interface
{})
(
n
int
,
err
os
.
Error
)
{
s
:=
newScanState
(
r
,
false
)
n
=
s
.
doScan
(
a
)
...
...
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