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

Avoid adding a redundant newline when printing weblistPageClosing #665

Merged
merged 3 commits into from
Nov 4, 2021

Conversation

zpavlinovic
Copy link
Contributor

@zpavlinovic zpavlinovic commented Nov 3, 2021

weblistPageClosing string ends in a new line, so printing it via fmt.Println will add an extra new line.

This would otherwise be caught with the improved vet printf
checker (golang/go#30436).
@google-cla google-cla bot added the cla: yes label Nov 3, 2021
aalexand
aalexand previously approved these changes Nov 3, 2021
This would otherwise be caught with the improved vet printf
checker (golang/go#30436).
Copy link
Collaborator

@aalexand aalexand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you elaborate why is this change needed? What's wrong with Println?

@aalexand
Copy link
Collaborator

aalexand commented Nov 4, 2021

Could you elaborate why is this change needed? What's wrong with Println?

If this is to avoid a redundant newline, then I think it's easier to update the value of the weblistPageClosing var to remove it there and leave the code as is.

And also the PR description needs to be updated I think. I don't think this change has anything to do with the linked 'go vet' changes. Those changes are about format strings for Printf.

@zpavlinovic
Copy link
Contributor Author

Could you elaborate why is this change needed? What's wrong with Println?

If this is to avoid a redundant newline, then I think it's easier to update the value of the weblistPageClosing var to remove it there and leave the code as is.

Sounds good.

And also the PR description needs to be updated I think. I don't think this change has anything to do with the linked 'go vet' changes. Those changes are about format strings for Printf.

Yes, it is about avoiding a redundant new line. The reason I mentioned vet is because a previous limitation has been recently addressed. I will change the description.

@zpavlinovic zpavlinovic changed the title Replace fmt.Println with fmt.Printf for the constant newline-ending string weblistPageClosing. Avoid adding a redundant newline when printing weblistPageClosing Nov 4, 2021
@aalexand
Copy link
Collaborator

aalexand commented Nov 4, 2021

The description still mentions "go vet".

@zpavlinovic
Copy link
Contributor Author

The description still mentions "go vet".

Hopefully, I have corrected it at all the relevant places now.

@codecov-commenter
Copy link

codecov-commenter commented Nov 4, 2021

Codecov Report

Merging #665 (0b0dd28) into master (f410f49) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #665   +/-   ##
=======================================
  Coverage   68.19%   68.19%           
=======================================
  Files          41       41           
  Lines        7391     7391           
=======================================
  Hits         5040     5040           
  Misses       1910     1910           
  Partials      441      441           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f410f49...0b0dd28. Read the comment docs.

@aalexand aalexand merged commit f987b9c into google:master Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants