summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Amsterdam <jba@google.com>2023-05-12 11:33:20 -0400
committerJonathan Amsterdam <jba@google.com>2023-05-15 19:12:45 +0000
commitff3aefbad4bed0cdd25688329e5cc4f908276a46 (patch)
tree5ead031f39d78e5df819adbd82ea8ebe8b27b908
parent4481042c4307f880b89e03c17e75420d5512135d (diff)
downloadgo-git-ff3aefbad4bed0cdd25688329e5cc4f908276a46.tar.gz
log/slog: document that NewRecord should be used to create a record
Change-Id: I5ce32a94660bdf12c577fd7f41a7627469f6467b Reviewed-on: https://go-review.googlesource.com/c/go/+/494618 Run-TryBot: Jonathan Amsterdam <jba@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com>
-rw-r--r--src/log/slog/record.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/log/slog/record.go b/src/log/slog/record.go
index 77dcc477fd..972552d519 100644
--- a/src/log/slog/record.go
+++ b/src/log/slog/record.go
@@ -15,6 +15,7 @@ const nAttrsInline = 5
// A Record holds information about a log event.
// Copies of a Record share state.
// Do not modify a Record after handing out a copy to it.
+// Call [NewRecord] to create a new Record.
// Use [Record.Clone] to create a copy with no shared state.
type Record struct {
// The time at which the output method (Log, Info, etc.) was called.