Skip to content

Commit c9649c9

Browse files
authored
minor document updates (#286)
* minor document updates
1 parent 5e05f98 commit c9649c9

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ cmds offers tools for describing and calling commands both locally and remotely,
1515

1616
## Documentation
1717

18-
https://godoc.org/github.com/ipfs/go-ipfs-cmds
18+
https://pkg.go.dev/github.com/ipfs/go-ipfs-cmds
1919

2020
## Contribute
2121

@@ -30,4 +30,3 @@ This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/c
3030
## License
3131

3232
MIT
33-

command_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,9 +373,9 @@ func TestEmitterExpectError(t *testing.T) {
373373

374374
switch re.errorCount {
375375
case 0:
376-
t.Errorf("expected SetError to be called")
376+
t.Errorf("expected CloseWithError to be called")
377377
case 1:
378378
default:
379-
t.Errorf("expected SetError to be called once, but was called %d times", re.errorCount)
379+
t.Errorf("expected CloseWithError to be called once, but was called %d times", re.errorCount)
380380
}
381381
}

doc.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,8 @@ from.
6060
Responses have a method Next() that returns the next
6161
emitted value and an error value. If the last element has been
6262
received, the returned error value is io.EOF. If the
63-
application code has sent an error using SetError, the error
64-
ErrRcvdError is returned on next, indicating that the caller
65-
should call Error(). Depending on the reponse type, other
66-
errors may also occur.
63+
application's code encounters a fatal error, it will call CloseWithError,
64+
and that the error value will be returned via subsiquent calls to Next().
6765
6866
# Pipes
6967

responseemitter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ type ResponseEmitter interface {
4141
CloseWithError(error) error
4242

4343
// SetLength sets the length of the output
44-
// err is an interface{} so we don't have to manually convert to error.
4544
SetLength(length uint64)
4645

4746
// Emit sends a value.
@@ -71,6 +70,7 @@ func Copy(re ResponseEmitter, res Response) error {
7170
}
7271
}
7372

73+
// EmitChan reads a value from a channel and send that value to re.
7474
func EmitChan(re ResponseEmitter, ch <-chan interface{}) error {
7575
for v := range ch {
7676
err := re.Emit(v)

0 commit comments

Comments
 (0)