From 1384c27ad0ffa5c44caf9c782711477b21f6fd02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Thu, 11 Jul 2024 06:39:08 +0200 Subject: [PATCH] log: Add missing notice to Bytes, Slice, Map doc comment (#5598) Add comment which is already in `BytesValue`, `SliceValue`, `MapValue`. Maybe it would help mitigating issues like https://github.com/open-telemetry/opentelemetry-go-contrib/issues/5879. --- log/keyvalue.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/log/keyvalue.go b/log/keyvalue.go index 8258defe360..296840a4468 100644 --- a/log/keyvalue.go +++ b/log/keyvalue.go @@ -351,16 +351,19 @@ func Bool(key string, value bool) KeyValue { } // Bytes returns a KeyValue for a []byte value. +// The passed slice must not be changed after it is passed. func Bytes(key string, value []byte) KeyValue { return KeyValue{key, BytesValue(value)} } // Slice returns a KeyValue for a []Value value. +// The passed slice must not be changed after it is passed. func Slice(key string, value ...Value) KeyValue { return KeyValue{key, SliceValue(value...)} } // Map returns a KeyValue for a map value. +// The passed slice must not be changed after it is passed. func Map(key string, value ...KeyValue) KeyValue { return KeyValue{key, MapValue(value...)} }