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

Question: is there a way to tweak gopls "organize imports" so that when I use the zerolog logger in my code, it imports the right package? #683

Closed
nchelluri opened this issue Aug 9, 2024 · 1 comment

Comments

@nchelluri
Copy link

nchelluri commented Aug 9, 2024

Simply, every time I write something like

log.Info().Msg("Hello, world")

and github.com/rs/zerolog/log is not yet imported, and I save my code file, then gopls will think that I mean github.com/pingcap/log instead. Do others encounter this issue, and is there a way around it?

Thank you for your work on this library.

@nchelluri nchelluri changed the title Question: is there a way to tweak goimports so that when I use the zerolog logger in my code, it imports the right package? Question: is there a way to tweak gopls "organize imports" so that when I use the zerolog logger in my code, it imports the right package? Aug 14, 2024
@nchelluri
Copy link
Author

I am not sure what happened but somewhere in the last little while this stopped being an issue for me. Maybe it was a gopls version upgrade, not sure.

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

No branches or pull requests

1 participant