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

Support for golang.org/x/exp/slog #71

Closed
uroborosq opened this issue Feb 15, 2025 · 4 comments
Closed

Support for golang.org/x/exp/slog #71

uroborosq opened this issue Feb 15, 2025 · 4 comments

Comments

@uroborosq
Copy link

Hello, thanks for your linter! It's definitely what I was looking for.

In our code base we are forced to use exp version of slog.
Unfortunately, this linter is not triggered when experimental version is used.

Would be great to have the same rules applied to experimental version of slog

@ccoVeille
Copy link

ccoVeille commented Feb 15, 2025

Your request seems valid 👍

In our code base we are forced to use exp version of slog.

I'm curious. Why that old version of Go? Better performance for exp/slog? New method available? Something else.

I'm asking because I recently suggested adding exp/slog to exptostd linter

uroborosq added a commit to uroborosq/sloglint that referenced this issue Feb 15, 2025
@uroborosq
Copy link
Author

@ccoVeille we are using some wrapper of slog, which was developed by common platform department (not us). So only this is forcing to use.

Don't really know why they chose exp version, I thought that there are more features, but it looks like I was wrong.

@tmzane
Copy link
Member

tmzane commented Feb 16, 2025

@uroborosq Hello,

In our code base we are forced to use exp version of slog.

which was developed by common platform department (not us). So only this is forcing to use.

While I do understand your motivation, I'm not sure it's worth the change. IIRC, log/slog was introduced in Go 1.21, so I assume you're on still on 1.20 or even less. Did you try to push an upgrade to a newer version for your common platform? Not for new features, but for security patches at least (only the latest 2 version of Go are officially supported with the latest one being 1.24). Let me know if it's possible to upgrade, it seems to be much simpler and desirable solution.

Your codebase will move on to log/slog eventually, but the support for exp/slog would be here forever. And if (highly unlikely but still) some new API would ever be introduced in the experimental package, we would have to support it. I'm also not sure that both packages have 1:1 similar APIs, did you check this?

And if we support exp/slog, I don't know what to do with tests. Commiting to support it means proper testing. And I really don't want to double the amount of tests, there are already too many.

@uroborosq
Copy link
Author

@tmzane ok, I see you point, I can understand why you don't want to support this.

I'll try to negotiate with that team then, thanks for answering!

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

3 participants