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
fce5d60b
Commit
fce5d60b
authored
Jan 07, 2010
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a standard interface that wraps ReadByte, io.ReadByter
R=rsc CC=golang-dev
https://golang.org/cl/181163
parent
4cde1a90
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
src/pkg/io/io.go
src/pkg/io/io.go
+8
-0
No files found.
src/pkg/io/io.go
View file @
fce5d60b
...
...
@@ -150,6 +150,14 @@ type WriterAt interface {
WriteAt
(
p
[]
byte
,
off
int64
)
(
n
int
,
err
os
.
Error
)
}
// ReadByter is the interface that wraps the ReadByte method.
//
// ReadByte reads and returns the next byte from the input.
// If no byte is available, err will be set.
type
ReadByter
interface
{
ReadByte
()
(
c
byte
,
err
os
.
Error
)
}
// WriteString writes the contents of the string s to w, which accepts an array of bytes.
func
WriteString
(
w
Writer
,
s
string
)
(
n
int
,
err
os
.
Error
)
{
return
w
.
Write
(
strings
.
Bytes
(
s
))
...
...
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