internal/testlog: add a comment about stripping of the timestamp in the unit test

This commit is contained in:
Jared Wasinger 2025-04-02 21:17:56 +02:00
parent 8c2236e586
commit 32a5f9b535

View file

@ -25,6 +25,8 @@ func (t *mockT) Logf(format string, args ...any) {
if _, err := fmt.Fprintf(&lineBuf, fmt.Sprintf(format, args...)); err != nil {
panic(err)
}
// The timestamp is locale-dependent, so we want to trim that off
// "INFO [01-01|00:00:00.000] a message ..." -> "a message..."
sanitized := strings.Split(lineBuf.String(), "]")[1]
if _, err := t.out.Write([]byte(sanitized)); err != nil {
panic(err)