Skip to content

Commit af8b7f0

Browse files
committed
adjusts comments
1 parent f3f9b49 commit af8b7f0

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

watcher.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ type aiocb struct {
2323

2424
// OpResult is the result of an aysnc-io
2525
type OpResult struct {
26-
// related file descriptor to this result
26+
// Related file descriptor to this result
2727
Fd int
28-
// if the operation is Write, buffer is the original committed one
29-
// if the operation is Read, buffer points to internal buffer, you need
28+
// If the operation is Write, buffer is the original committed one,
29+
// if the operation is Read, buffer points to a internal buffer, you need
3030
// to process immediately, or copy and save by yourself.
3131
Buffer []byte
32-
// number of bytes sent or received, Buffer[:Size] is the content
32+
// Number of bytes sent or received, Buffer[:Size] is the content sent or received.
3333
Size int
3434
// IO error
3535
Err error
@@ -147,7 +147,8 @@ func (w *Watcher) StopWatch(fd int) {
147147
}
148148
}
149149

150-
// Read submits a read requests and notify with done, the cap(done) must be 0, i.e unbuffered chan.
150+
// Read submits a read requests and notify IO-completion with done channel,
151+
// the capacity of done has to be be 0, i.e an unbuffered chan.
151152
func (w *Watcher) Read(fd int, done chan OpResult) error {
152153
if cap(done) != 0 {
153154
return ErrBufferedChan
@@ -160,7 +161,8 @@ func (w *Watcher) Read(fd int, done chan OpResult) error {
160161
}
161162
}
162163

163-
// Write submits a write requests and notify with done, the cap(done) must be 0, i.e unbuffered chan.
164+
// Write submits a write requests and notify IO-completion with done channel,
165+
// the capacity of done has to be be 0, i.e an unbuffered chan.
164166
func (w *Watcher) Write(fd int, buf []byte, done chan OpResult) error {
165167
// do nothing
166168
if len(buf) == 0 {

0 commit comments

Comments
 (0)