Skip to content

minor document updates #286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cmds offers tools for describing and calling commands both locally and remotely,

## Documentation

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

## Contribute

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

MIT

4 changes: 2 additions & 2 deletions command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,9 @@ func TestEmitterExpectError(t *testing.T) {

switch re.errorCount {
case 0:
t.Errorf("expected SetError to be called")
t.Errorf("expected CloseWithError to be called")
case 1:
default:
t.Errorf("expected SetError to be called once, but was called %d times", re.errorCount)
t.Errorf("expected CloseWithError to be called once, but was called %d times", re.errorCount)
}
}
6 changes: 2 additions & 4 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,8 @@ from.
Responses have a method Next() that returns the next
emitted value and an error value. If the last element has been
received, the returned error value is io.EOF. If the
application code has sent an error using SetError, the error
ErrRcvdError is returned on next, indicating that the caller
should call Error(). Depending on the reponse type, other
errors may also occur.
application's code encounters a fatal error, it will call CloseWithError,
and that the error value will be returned via subsiquent calls to Next().

# Pipes

Expand Down
2 changes: 1 addition & 1 deletion responseemitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ type ResponseEmitter interface {
CloseWithError(error) error

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

// Emit sends a value.
Expand Down Expand Up @@ -71,6 +70,7 @@ func Copy(re ResponseEmitter, res Response) error {
}
}

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