You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2022/05/03 20:23:02 UTC

[GitHub] [trafficcontrol] ocket8888 commented on a diff in pull request #5696: Change lib/go-log to escape newlines

ocket8888 commented on code in PR #5696:
URL: https://github.com/apache/trafficcontrol/pull/5696#discussion_r864192839


##########
lib/go-log/log_test.go:
##########
@@ -42,3 +42,15 @@ func TestUTC(t *testing.T) {
 		t.Errorf("expected UTC time, actual '" + actual + "'")
 	}
 }
+
+func TestNewlinesSingleLogLine(t *testing.T) {
+	buf := &bytes.Buffer{}
+	Init(nil, writeCloser{buf}, nil, nil, nil)
+	// Have to concatenate, because Go doesn't allow you to test multiple trailing newline behavior.
+	Errorln("foo\n\nbar\n" + "\n" + "\n")

Review Comment:
   What does this mean? Surely Go doesn't just blatantly use different strings than the ones the programmer creates?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org