Skip to content
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

WithKeys method append an unexpected separator to the last message key #1030

Closed
gaofeihang opened this issue Apr 7, 2023 · 1 comment · Fixed by #1031
Closed

WithKeys method append an unexpected separator to the last message key #1030

gaofeihang opened this issue Apr 7, 2023 · 1 comment · Fixed by #1031
Labels
good first issue Good for newcomers
Milestone

Comments

@gaofeihang
Copy link
Contributor

gaofeihang commented Apr 7, 2023

BUG REPORT

  1. Please describe the issue you observed:

    • What did you do (The steps to reproduce)?

    • What did you expect to see?

    • What did you see instead?

Run the test below

func TestMessageKey(t *testing.T) {
	msg := &Message{}
	expected := "testKey"
	msg.WithKeys([]string{expected})
	actual := msg.GetKeys()
	if actual != expected {
		t.Fatalf("get message key error: expected is '%s', actual is '%s'", expected, actual)
	}
}

Expect msg.GetKeys() returns the same key as what msg.WithKeys() put.
msg.WithKeys() append an unexpected key separator ' ' to the message key instead.
The test outputs get message key error: expected is 'testKey', actual is 'testKey '

  1. Please tell us about your environment:

    • What is your OS?

    • What is your client version?

    • What is your RocketMQ version?

master code of rocketmq-client-go

gaofeihang added a commit to gaofeihang/rocketmq-client-go that referenced this issue Apr 7, 2023
@francisoliverlee francisoliverlee added the good first issue Good for newcomers label Apr 25, 2023
@francisoliverlee
Copy link
Member

nice it!

@cserwen cserwen added this to the 2.1.2 milestone Apr 27, 2023
gaofeihang added a commit to gaofeihang/rocketmq-client-go that referenced this issue Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants