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

fmt: Change (*pp).fmtBool to (*pp).fmtBoolean for consistency #30312

Closed
tomocy opened this issue Feb 19, 2019 · 2 comments
Closed

fmt: Change (*pp).fmtBool to (*pp).fmtBoolean for consistency #30312

tomocy opened this issue Feb 19, 2019 · 2 comments

Comments

@tomocy
Copy link
Contributor

@tomocy tomocy commented Feb 19, 2019

at fmt/print.go:652

case bool:
    p.fmtBool(f, verb)

but seeing the blow, (*pp).fmtInteger (not (*pp).fmtInt) is found.
So considering the consistency, (*pp).fmtBool should be renamed (*pp).fmtBoolean

What do you think?

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Feb 19, 2019

Thanks, but I don't think it's worth changing. fmtInt is potentially confusing in that it suggests that it only works for the int type, whereas of course it works for any integer type. fmtBool, on the other hand, really does work only for the bool type.

Also, more generally, there's not much benefit to making minor changes to working code. It can only break things. Of course where the code is really unclear it is a good idea to rewrite it to make it easier to understand. But that is not the case here.

@tomocy
Copy link
Contributor Author

@tomocy tomocy commented Feb 19, 2019

Thnks for reviewing!
I understood : )

@golang golang locked and limited conversation to collaborators Feb 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.