From d7fda7d0cc0025c3a17c99345ab23575155ec095 Mon Sep 17 00:00:00 2001 From: Joachim Bauch Date: Wed, 7 Feb 2024 21:22:19 +0100 Subject: [PATCH] [IMPROVED] Fix typos in comments. (#1547) Signed-off-by: Joachim Bauch --- encoders/builtin/default_enc.go | 2 +- example_test.go | 2 +- jetstream/stream_config.go | 2 +- micro/test/service_test.go | 2 +- object.go | 2 +- test/conn_test.go | 2 +- test/js_test.go | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/encoders/builtin/default_enc.go b/encoders/builtin/default_enc.go index 7e729637c..c1d0f6f0b 100644 --- a/encoders/builtin/default_enc.go +++ b/encoders/builtin/default_enc.go @@ -24,7 +24,7 @@ import ( // DefaultEncoder implementation for EncodedConn. // This encoder will leave []byte and string untouched, but will attempt to // turn numbers into appropriate strings that can be decoded. It will also -// propely encoded and decode bools. If will encode a struct, but if you want +// properly encoded and decode bools. If will encode a struct, but if you want // to properly handle structures you should use JsonEncoder. type DefaultEncoder struct { // Empty diff --git a/example_test.go b/example_test.go index 26327f380..6aa93636c 100644 --- a/example_test.go +++ b/example_test.go @@ -612,7 +612,7 @@ func ExampleSubOpt() { nats.MaxDeliver(1), // Activate Flow control algorithm from the server. nats.EnableFlowControl(), - // Track heartbeats from the server fro missed sequences. + // Track heartbeats from the server for missed sequences. nats.IdleHeartbeat(500*time.Millisecond), ) diff --git a/jetstream/stream_config.go b/jetstream/stream_config.go index e0133d807..dd1f9d941 100644 --- a/jetstream/stream_config.go +++ b/jetstream/stream_config.go @@ -123,7 +123,7 @@ type ( // // If set to true, publish methods from the JetStream client will not // work as expected, since they rely on acknowledgements. Core NATS - // publish methods should be used instead. Note tha this will make + // publish methods should be used instead. Note that this will make // message delivery less reliable. NoAck bool `json:"no_ack,omitempty"` diff --git a/micro/test/service_test.go b/micro/test/service_test.go index 30cfa45a0..b9e004946 100644 --- a/micro/test/service_test.go +++ b/micro/test/service_test.go @@ -181,7 +181,7 @@ func TestServiceBasics(t *testing.T) { // Services should process 50 requests total if requestsNum != 50 { - t.Fatalf("Expected a total fo 50 requests processed, got: %d", requestsNum) + t.Fatalf("Expected a total of 50 requests processed, got: %d", requestsNum) } // Reset stats for a service svcs[0].Reset() diff --git a/object.go b/object.go index 0c6647ed9..72e1ef44f 100644 --- a/object.go +++ b/object.go @@ -384,7 +384,7 @@ func (obs *obs) Put(meta *ObjectMeta, r io.Reader, opts ...ObjectOpt) (*ObjectIn case <-time.After(obs.js.opts.wait): } if err := obs.js.purgeStream(obs.stream, &StreamPurgeRequest{Subject: chunkSubj}); err != nil { - return fmt.Errorf("could not cleanup bucket after erronous put operation: %w", err) + return fmt.Errorf("could not cleanup bucket after erroneous put operation: %w", err) } return nil } diff --git a/test/conn_test.go b/test/conn_test.go index 588acc222..e621c902b 100644 --- a/test/conn_test.go +++ b/test/conn_test.go @@ -2890,7 +2890,7 @@ func TestTLSHandshakeFirst(t *testing.T) { tlsConf.ServerName = "localhost" // Start a mockup server that will do the TLS handshake first - // and then send the INFO protcol. + // and then send the INFO protocol. l, e := net.Listen("tcp", ":0") if e != nil { t.Fatal("Could not listen on an ephemeral port") diff --git a/test/js_test.go b/test/js_test.go index 631eda65c..4ae2915cf 100644 --- a/test/js_test.go +++ b/test/js_test.go @@ -8622,7 +8622,7 @@ func TestJetStreamMsgSubjectRewrite(t *testing.T) { t.Fatalf("Subject should be %q, got %q", "foo", msg.Subject) } if string(msg.Data) != "msg" { - t.Fatalf("Unexepcted data: %q", msg.Data) + t.Fatalf("Unexpected data: %q", msg.Data) } }