]> Cypherpunks.ru repositories - gostls13.git/commit
log/slog: fix check for nil prefix
authorJonathan Amsterdam <jba@google.com>
Fri, 19 May 2023 11:31:44 +0000 (07:31 -0400)
committerJonathan Amsterdam <jba@google.com>
Mon, 22 May 2023 18:27:16 +0000 (18:27 +0000)
commit2f1e643229d19f40a5f80dc3784daaff83d5cc02
tree99f965fe4ad8778bbe0c8f37554a520479637a7d
parentbc96901e8959c5eb21d5bca5614eb66481815918
log/slog: fix check for nil prefix

Previously, handleState.prefix was nil if and only if the length of
the prefix was zero. Now, prefix is never nil.

Fix the nil check in the code by also checking if the length is non-zero.

Change-Id: I9f69c0029cb1c73fe6c2919c78fee7d4085bfd85
Reviewed-on: https://go-review.googlesource.com/c/go/+/495977
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
src/log/slog/handler.go