Skip to content

Spelling #118

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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 @@ -10,8 +10,7 @@

> an implementation of the multistream protocol in go

This package implements a simple stream router for the multistream-select protocol.
The protocol is defined [here](https://github.com/multiformats/multistream-select).
This package implements a simple stream router for the [multistream-select protocol](https://github.com/multiformats/multistream-select).
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't technically a spelling error, but it's easy enough to look for other things at the same time, the rule is:

Do not use (click) here links

For more information, see:


## Table of Contents

Expand Down
2 changes: 1 addition & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func SelectProtoOrFail[T StringLike](proto T, rwc io.ReadWriteCloser) (err error
errCh := make(chan error, 1)
go func() {
var buf bytes.Buffer
if err := delitmWriteAll(&buf, []byte(ProtocolID), []byte(proto)); err != nil {
if err := delimWriteAll(&buf, []byte(ProtocolID), []byte(proto)); err != nil {
errCh <- err
return
}
Expand Down
6 changes: 3 additions & 3 deletions multistream.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Package multistream implements a simple stream router for the
// multistream-select protocoli. The protocol is defined at
// multistream-select protocol. The protocol is defined at
// https://github.com/multiformats/multistream-select
package multistream

Expand Down Expand Up @@ -88,7 +88,7 @@ func delimWriteBuffered(w io.Writer, mes []byte) error {
return bw.Flush()
}

func delitmWriteAll(w io.Writer, messages ...[]byte) error {
func delimWriteAll(w io.Writer, messages ...[]byte) error {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is based on it calling delimWrite below...

for _, mes := range messages {
if err := delimWrite(w, mes); err != nil {
return fmt.Errorf("failed to write messages %s, err: %v ", string(mes), err)
Expand Down Expand Up @@ -159,7 +159,7 @@ func (msm *MultistreamMuxer[T]) removeHandler(protocol T) {
}
}

// Protocols returns the list of handler-names added to this this muxer.
// Protocols returns the list of handler-names added to this muxer.
func (msm *MultistreamMuxer[T]) Protocols() []T {
msm.handlerlock.RLock()
defer msm.handlerlock.RUnlock()
Expand Down
8 changes: 4 additions & 4 deletions multistream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ func (rob *readonlyBuffer) Close() error {
return nil
}

func TestNegotiatThenWriteFail(t *testing.T) {
func TestNegotiateThenWriteFail(t *testing.T) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that changes to go test names are fairly harmless even though they're public functions...

buf := new(bytes.Buffer)

err := delimWrite(buf, []byte(ProtocolID))
Expand Down Expand Up @@ -753,8 +753,8 @@ func TestNegotiatePeerSendsAndCloses(t *testing.T) {
if err != nil {
t.Fatal(err)
}
delimtedProtocolID := make([]byte, buf.Len())
copy(delimtedProtocolID, buf.Bytes())
delimitedProtocolID := make([]byte, buf.Len())
copy(delimitedProtocolID, buf.Bytes())
Comment on lines +756 to +757
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rough guess


err = delimWrite(&buf, []byte("foo"))
if err != nil {
Expand All @@ -777,7 +777,7 @@ func TestNegotiatePeerSendsAndCloses(t *testing.T) {
// We mock the closed stream by only expecting a single write. The
// mockstream will error on any more writes (same as writing to a closed
// stream)
expectWrite: [][]byte{delimtedProtocolID},
expectWrite: [][]byte{delimitedProtocolID},
toRead: [][]byte{buf.Bytes()},
},
},
Expand Down