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

log: Clarify that Print and Println are doing the exact same thing #42783

Closed
JensRantil opened this issue Nov 23, 2020 · 1 comment
Closed

log: Clarify that Print and Println are doing the exact same thing #42783

JensRantil opened this issue Nov 23, 2020 · 1 comment

Comments

@JensRantil
Copy link

I'm always confused whether I should use log.Print or log.Println (and I've been coding small Golang apps for years). Today I spend some time digging into the difference and I had to do human word-by-word comparison to conclude that they are doing the exact same thing. https://golang.org/pkg/log/#Print and https://golang.org/pkg/log/#Println both state

X calls Output to print to the standard logger. Arguments are handled in the manner of fmt.Println.

Proposal to improve the documentation:

  • Either change https://golang.org/pkg/log/#Println to "Println is an alias for Print"; or
  • Modify both docs to something like "X calls Output to print to the standard logger. Arguments are handled in the manner of fmt.Println. This function does the same as Y."

Also, this entire issue is under the assumption that one of the methods shouldn't be deprecated (I assume they are both being used in a lot of places).

@JensRantil
Copy link
Author

They are not the same...

@golang golang locked and limited conversation to collaborators Nov 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants