From 02c2d5ccb3a595c8f2cc2695ed4164cdd614a995 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Thu, 20 Feb 2025 19:09:14 -0500 Subject: [PATCH 1/6] spelling: delim Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- client.go | 2 +- multistream.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client.go b/client.go index 5ca9885..c3931fc 100644 --- a/client.go +++ b/client.go @@ -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 } diff --git a/multistream.go b/multistream.go index 17e1ef7..d94b3c4 100644 --- a/multistream.go +++ b/multistream.go @@ -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 { for _, mes := range messages { if err := delimWrite(w, mes); err != nil { return fmt.Errorf("failed to write messages %s, err: %v ", string(mes), err) From 61beb53b9e12a50adc6aa8d819c75736adcc445e Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Thu, 20 Feb 2025 19:08:41 -0500 Subject: [PATCH 2/6] spelling: delimited Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- multistream_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/multistream_test.go b/multistream_test.go index 9828ac4..5d2c6fe 100644 --- a/multistream_test.go +++ b/multistream_test.go @@ -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()) err = delimWrite(&buf, []byte("foo")) if err != nil { @@ -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()}, }, }, From ad7be79675795c0f54e859c6d6f4f19e2767d292 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Thu, 20 Feb 2025 19:09:47 -0500 Subject: [PATCH 3/6] spelling: negotiate Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- multistream_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multistream_test.go b/multistream_test.go index 5d2c6fe..f4633a6 100644 --- a/multistream_test.go +++ b/multistream_test.go @@ -677,7 +677,7 @@ func (rob *readonlyBuffer) Close() error { return nil } -func TestNegotiatThenWriteFail(t *testing.T) { +func TestNegotiateThenWriteFail(t *testing.T) { buf := new(bytes.Buffer) err := delimWrite(buf, []byte(ProtocolID)) From d351c2c08de41e111e5387fca174a7bc24ffd04b Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Thu, 20 Feb 2025 19:10:01 -0500 Subject: [PATCH 4/6] spelling: protocol Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- multistream.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multistream.go b/multistream.go index d94b3c4..285e3dc 100644 --- a/multistream.go +++ b/multistream.go @@ -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 From 0b71500133a278eeccd7a7ae365c91afc87c063c Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Thu, 20 Feb 2025 22:06:49 -0500 Subject: [PATCH 5/6] spelling: this Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- multistream.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multistream.go b/multistream.go index 285e3dc..a7ea267 100644 --- a/multistream.go +++ b/multistream.go @@ -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() From d18a07f1f1fa42e7babf5b5150b72c50d4344493 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Thu, 20 Feb 2025 22:07:13 -0500 Subject: [PATCH 6/6] link: multistream-select protocol Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index f766b69..f125701 100644 --- a/README.md +++ b/README.md @@ -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). ## Table of Contents