-
Notifications
You must be signed in to change notification settings - Fork 6
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
draft: syscall support #101
Conversation
Thanks for @nobe4 for letting me know these constants existed Please note this could provide a solution for Here someone is complaining about the fact these are not real "magical numbers" Having usestdlibvars that suggests a solution seems to be the right direction. Please note, I don't think the solution should be in mnd, but in your linter, that's why I opened a PR here |
@ccoVeille thank you! @ldez hello, what you mean about this? |
the
The right way is to use |
Sure, I can migrate to use https://cs.opensource.google/go/x/sys/+/refs/tags/v0.29.0:unix/zerrors_linux.go;l=3284-3300 |
this linter is about std lib 😉 |
But then it's no longer about std lib I'm unsure What do you guys think? |
I think this is off-topic for this linter. Also, the meaning behind this linter is to improve readability and maintenance, I am not sure this is a good idea to replace those numbers with constants: those numbers are "easier" to read and use than the constants. |
I wasn't planning it to be enabled often. I expected some people to look for this notation. But now, the syscall package is discouraged, and golang/sys is. It would be out of std lib constants, so out of this linter. Things add them up badly. I'm likely to close this PR |
I closed @sashamelentyev Feel free to provide a feedback or reopen if you think there is an interest |
I recently found out these constants
They are used, but not so much
https://github.com/search?q=language%3Ago+%22syscall.S_IR%22&type=code
So I made this addition.
Please note, the implementation is naive
I should check against the list bits instead of hard-coding all the values, but it's enough to present the idea
I know I have to manage
*os.File
, the changes are pretty similar and should be easy.So please tell me if you find any interest in this