1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-04-13 11:30:31 +02:00

Rename log List value type to Slice (#4936)

This commit is contained in:
Tyler Yahn 2024-02-18 08:08:28 -08:00 committed by GitHub
parent 59413575e4
commit 6e2bfb69ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 15 deletions

View File

@ -262,7 +262,7 @@ const (
KindInt64 KindInt64
KindString KindString
KindBytes KindBytes
KindList KindSlice
KindMap KindMap
) )
@ -282,7 +282,7 @@ func BoolValue(v bool) Value
func BytesValue(v []byte) Value func BytesValue(v []byte) Value
func ListValue(vs ...Value) Value func SliceValue(vs ...Value) Value
func MapValue(kvs ...KeyValue) Value func MapValue(kvs ...KeyValue) Value
@ -300,7 +300,7 @@ func (v Value) AsFloat64() float64
func (v Value) AsBytes() []byte func (v Value) AsBytes() []byte
func (v Value) AsList() []Value func (v Value) AsSlice() []Value
func (v Value) AsMap() []KeyValue func (v Value) AsMap() []KeyValue
@ -330,7 +330,7 @@ func Bool(key string, v bool) KeyValue
func Bytes(key string, v []byte) KeyValue func Bytes(key string, v []byte) KeyValue
func List(key string, args ...Value) KeyValue func Slice(key string, args ...Value) KeyValue
func Map(key string, args ...KeyValue) KeyValue func Map(key string, args ...KeyValue) KeyValue
@ -349,7 +349,7 @@ func (a KeyValue) Equal(b KeyValue) bool
`KindInt64` is used for a signed integer value. `KindInt64` is used for a signed integer value.
`KindString` is used for a string value. `KindString` is used for a string value.
`KindBytes` is used for a slice of bytes (in spec: A byte array). `KindBytes` is used for a slice of bytes (in spec: A byte array).
`KindList` is used for a slice of values (in spec: an array (a list) of any values). `KindSlice` is used for a slice of values (in spec: an array (a list) of any values).
`KindMap` is used for a slice of key-value pairs (in spec: `map<string, any>`). `KindMap` is used for a slice of key-value pairs (in spec: `map<string, any>`).
These types are defined in `go.opentelemetry.io/otel/log` package These types are defined in `go.opentelemetry.io/otel/log` package

View File

@ -27,7 +27,7 @@ const (
KindInt64 KindInt64
KindString KindString
KindBytes KindBytes
KindList KindSlice
KindMap KindMap
) )
@ -56,9 +56,9 @@ func BoolValue(v bool) Value { //nolint:revive // Not a control flag.
// changed after it is passed. // changed after it is passed.
func BytesValue(v []byte) Value { return Value{} } // TODO (#4914): implement. func BytesValue(v []byte) Value { return Value{} } // TODO (#4914): implement.
// ListValue returns a [Value] for a slice of [Value]. The passed slice must // SliceValue returns a [Value] for a slice of [Value]. The passed slice must
// not be changed after it is passed. // not be changed after it is passed.
func ListValue(vs ...Value) Value { return Value{} } // TODO (#4914): implement. func SliceValue(vs ...Value) Value { return Value{} } // TODO (#4914): implement.
// MapValue returns a new [Value] for a slice of key-value pairs. The passed // MapValue returns a new [Value] for a slice of key-value pairs. The passed
// slice must not be changed after it is passed. // slice must not be changed after it is passed.
@ -82,8 +82,8 @@ func (v Value) AsFloat64() float64 { return 0 } // TODO (#4914): implement
// AsBytes returns the value held by v as a []byte. // AsBytes returns the value held by v as a []byte.
func (v Value) AsBytes() []byte { return nil } // TODO (#4914): implement func (v Value) AsBytes() []byte { return nil } // TODO (#4914): implement
// AsList returns the value held by v as a []Value. // AsSlice returns the value held by v as a []Value.
func (v Value) AsList() []Value { return nil } // TODO (#4914): implement func (v Value) AsSlice() []Value { return nil } // TODO (#4914): implement
// AsMap returns the value held by v as a []KeyValue. // AsMap returns the value held by v as a []KeyValue.
func (v Value) AsMap() []KeyValue { return nil } // TODO (#4914): implement func (v Value) AsMap() []KeyValue { return nil } // TODO (#4914): implement
@ -125,8 +125,8 @@ func Bool(key string, v bool) KeyValue { return KeyValue{} } // TODO (#4914): im
// Bytes returns an KeyValue for a []byte value. // Bytes returns an KeyValue for a []byte value.
func Bytes(key string, v []byte) KeyValue { return KeyValue{} } // TODO (#4914): implement func Bytes(key string, v []byte) KeyValue { return KeyValue{} } // TODO (#4914): implement
// List returns an KeyValue for a []Value value. // Slice returns an KeyValue for a []Value value.
func List(key string, args ...Value) KeyValue { return KeyValue{} } // TODO (#4914): implement func Slice(key string, args ...Value) KeyValue { return KeyValue{} } // TODO (#4914): implement
// Map returns an KeyValue for a map value. // Map returns an KeyValue for a map value.
func Map(key string, args ...KeyValue) KeyValue { return KeyValue{} } // TODO (#4914): implement func Map(key string, args ...KeyValue) KeyValue { return KeyValue{} } // TODO (#4914): implement

View File

@ -14,13 +14,13 @@ func _() {
_ = x[KindInt64-3] _ = x[KindInt64-3]
_ = x[KindString-4] _ = x[KindString-4]
_ = x[KindBytes-5] _ = x[KindBytes-5]
_ = x[KindList-6] _ = x[KindSlice-6]
_ = x[KindMap-7] _ = x[KindMap-7]
} }
const _Kind_name = "EmptyBoolFloat64Int64StringBytesListMap" const _Kind_name = "EmptyBoolFloat64Int64StringBytesSliceMap"
var _Kind_index = [...]uint8{0, 5, 9, 16, 21, 27, 32, 36, 39} var _Kind_index = [...]uint8{0, 5, 9, 16, 21, 27, 32, 37, 40}
func (i Kind) String() string { func (i Kind) String() string {
if i < 0 || i >= Kind(len(_Kind_index)-1) { if i < 0 || i >= Kind(len(_Kind_index)-1) {