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

docs: An example of using Writer to create a missing topic imports has an import error in README #1231

Closed
VMois opened this issue Nov 11, 2023 · 1 comment · Fixed by #1234
Assignees
Labels

Comments

@VMois
Copy link
Contributor

VMois commented Nov 11, 2023

Describe the bug

An example of creating a missing topic using Writer in README (link) is using this snippet to check for retriable errors:

if errors.Is(err, LeaderNotAvailable) || errors.Is(err, context.DeadlineExceeded) {
        time.Sleep(time.Millisecond * 250)
        continue
}

Go complains that LeaderNotAvailable is not found. You need to change the line to kafka.LeaderNotAvailable for it to work. An example from my learning project here.

If it is okay, I would like to open PR with a fix. Thank you.

Kafka Version

Not applicable

To Reproduce

If you copy the code directly, it will complain that LeaderNotAvailable does not exist.

Expected Behavior

As a new user, I expect to copy an example and it should work (at least compile)

Observed Behavior

Not Applicable

Additional Context

Nothing

@VMois VMois added the bug label Nov 11, 2023
@petedannemann
Copy link
Contributor

Thanks for bringing this up, we would definitely appreciate a PR with this fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants