Skip to content

Commit 61f13e5

Browse files
committed
Elaborate on slog.Map.MarshalJSON contract
1 parent 5f1a804 commit 61f13e5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

map.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ type Map []Field
1616
var _ json.Marshaler = Map(nil)
1717

1818
// MarshalJSON implements json.Marshaler.
19+
//
20+
// It is guaranteed to return a nil error.
21+
// Any error marshalling a field will
22+
// become the field's value.
1923
func (m Map) MarshalJSON() ([]byte, error) {
2024
b := &bytes.Buffer{}
2125
b.WriteByte('{')

0 commit comments

Comments
 (0)