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>