Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrpio committed Sep 14, 2022
1 parent 2bdb6d0 commit c101ec9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion jserrors.go
Expand Up @@ -101,7 +101,7 @@ var (
// ErrRequireServerVersion is returned when using a feature which requires a higher server version.
ErrRequireServerVersion JetStreamError = &jsError{message: "invalid server version"}

// ErrConsumerNameMismtch is returned user provides both consumer name and durable name and they are not equal.
// ErrConsumerNameMismatch is returned user provides both consumer name and durable name and they are not equal.
ErrConsumerNameMismatch JetStreamError = &jsError{message: "consumer name and durable name do not match"}

// DEPRECATED: ErrInvalidDurableName is no longer returned and will be removed in future releases.
Expand Down
4 changes: 2 additions & 2 deletions jsm.go
Expand Up @@ -266,7 +266,7 @@ func (js *js) AddConsumer(stream string, cfg *ConsumerConfig, opts ...JSOpt) (*C
return nil, fmt.Errorf("%w: %s", ErrRequireServerVersion, "consumer name requires at least server version 2.9.0")
}
if cfg.Name != _EMPTY_ && cfg.Durable != _EMPTY_ && cfg.Name != cfg.Durable {
return nil, ErrConsumerNameMismtch
return nil, ErrConsumerNameMismatch
}
consumerName := cfg.Name
if consumerName == _EMPTY_ {
Expand Down Expand Up @@ -297,7 +297,7 @@ func (js *js) UpdateConsumer(stream string, cfg *ConsumerConfig, opts ...JSOpt)
return nil, fmt.Errorf("%w: %s", ErrRequireServerVersion, "consumer name requires at least server version 2.9.0")
}
if cfg.Name != _EMPTY_ && cfg.Durable != _EMPTY_ && cfg.Name != cfg.Durable {
return nil, ErrConsumerNameMismtch
return nil, ErrConsumerNameMismatch
}
consumerName := cfg.Name
if consumerName == _EMPTY_ {
Expand Down
2 changes: 1 addition & 1 deletion test/js_test.go
Expand Up @@ -1460,7 +1460,7 @@ func TestJetStreamManagement(t *testing.T) {
})

t.Run("with different Durable and Name set", func(t *testing.T) {
if _, err = js.AddConsumer("foo", &nats.ConsumerConfig{Name: "abc", Durable: "123"}); err != nats.ErrConsumerNameMismtch {
if _, err = js.AddConsumer("foo", &nats.ConsumerConfig{Name: "abc", Durable: "123"}); err != nats.ErrConsumerNameMismatch {
t.Fatalf("Expected: %v; got: %v", nats.ErrInvalidConsumerName, err)
}
})
Expand Down

0 comments on commit c101ec9

Please sign in to comment.