Skip to content

Commit

Permalink
log: Add missing notice to Bytes, Slice, Map doc comment (#5598)
Browse files Browse the repository at this point in the history
Add comment which is already in `BytesValue`, `SliceValue`, `MapValue`.

Maybe it would help mitigating issues like
open-telemetry/opentelemetry-go-contrib#5879.
  • Loading branch information
pellared committed Jul 11, 2024
1 parent e8c22e6 commit 1384c27
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions log/keyvalue.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...)}
}
Expand Down

0 comments on commit 1384c27

Please sign in to comment.