Skip to content

Commit 1384c27

Browse files
authored
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 open-telemetry/opentelemetry-go-contrib#5879.
1 parent e8c22e6 commit 1384c27

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

log/keyvalue.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,16 +351,19 @@ func Bool(key string, value bool) KeyValue {
351351
}
352352

353353
// Bytes returns a KeyValue for a []byte value.
354+
// The passed slice must not be changed after it is passed.
354355
func Bytes(key string, value []byte) KeyValue {
355356
return KeyValue{key, BytesValue(value)}
356357
}
357358

358359
// Slice returns a KeyValue for a []Value value.
360+
// The passed slice must not be changed after it is passed.
359361
func Slice(key string, value ...Value) KeyValue {
360362
return KeyValue{key, SliceValue(value...)}
361363
}
362364

363365
// Map returns a KeyValue for a map value.
366+
// The passed slice must not be changed after it is passed.
364367
func Map(key string, value ...KeyValue) KeyValue {
365368
return KeyValue{key, MapValue(value...)}
366369
}

0 commit comments

Comments
 (0)