commit | e0603bc6760ee48d32a4a96a0e9cc032698d8584 | [log] [tgz] |
---|---|---|
author | Joe Tsai <joetsai@digital-static.net> | Sat Feb 04 11:30:18 2023 -0800 |
committer | Joseph Tsai <joetsai@digital-static.net> | Mon Feb 06 18:44:49 2023 +0000 |
tree | 2103b88f6350992f449c57a58f17742d70bd133c | |
parent | 677038f86625447de738831b4be9bca23929787a [diff] |
log: fix and cleanup trailing newline logic The intent was to always append a newline if a newline was missing. The older logic accidentally only checked the payload for newlines and forgot to check the prefix as well. Fix it to check both together. This changes the output of Logger.Output in the situation where the prefix contains a trailing newline and the output is empty. This is a very rare combination and unlikely to occur in practice. Change-Id: Ic04ded6c29a90383e29bf7f59223a808ee1cbdc0 Reviewed-on: https://go-review.googlesource.com/c/go/+/465316 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com>
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 4.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Official binary distributions are available at https://go.dev/dl/.
After downloading a binary release, visit https://go.dev/doc/install for installation instructions.
If a binary distribution is not available for your combination of operating system and architecture, visit https://go.dev/doc/install/source for source installation instructions.
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines at https://go.dev/doc/contribute.
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://go.dev/wiki/Questions for a list of places to ask questions about the Go language.