fix: octalLiteral from go-critic#8811
Conversation
f819b2b to
d637008
Compare
knqyf263
left a comment
There was a problem hiding this comment.
Thanks for your contribution.
As far as I know, since both 0755 and 0o755 compile to the exact same value in Go 1.13+, could you share your reasoning for preferring 0o? For example, is this driven by an updated style guideline or readability concerns? I’d love to understand the benefits so we can decide on a consistent convention for the project.
|
To my understanding it is for more clarity.
This is recommended by go-critic and gofumpt, see "Octal integer literals should use the 0o prefix on modules using Go 1.13 and later" section |
knqyf263
left a comment
There was a problem hiding this comment.
Thanks for explaining. Since C doesn't support 0o prefix, I've never felt like 0 prefix is less clear. However, I don't mind either 0o or 0. We can follow it as some linters recommend 0o.
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
d637008 to
46e18ea
Compare
Description
Fixes octalLiteral rule from go-critic
Remove this section if you don't have related PRs.
Checklist