diff --git a/log/DESIGN.md b/log/DESIGN.md index 7528d3404..f08de5d84 100644 --- a/log/DESIGN.md +++ b/log/DESIGN.md @@ -262,7 +262,7 @@ const ( KindInt64 KindString KindBytes - KindList + KindSlice KindMap ) @@ -282,7 +282,7 @@ func BoolValue(v bool) Value func BytesValue(v []byte) Value -func ListValue(vs ...Value) Value +func SliceValue(vs ...Value) Value func MapValue(kvs ...KeyValue) Value @@ -300,7 +300,7 @@ func (v Value) AsFloat64() float64 func (v Value) AsBytes() []byte -func (v Value) AsList() []Value +func (v Value) AsSlice() []Value func (v Value) AsMap() []KeyValue @@ -330,7 +330,7 @@ func Bool(key string, v bool) 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 @@ -349,7 +349,7 @@ func (a KeyValue) Equal(b KeyValue) bool `KindInt64` is used for a signed integer value. `KindString` is used for a string value. `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`). These types are defined in `go.opentelemetry.io/otel/log` package diff --git a/log/keyvalue.go b/log/keyvalue.go index 0860e7600..b39c00a4b 100644 --- a/log/keyvalue.go +++ b/log/keyvalue.go @@ -27,7 +27,7 @@ const ( KindInt64 KindString KindBytes - KindList + KindSlice KindMap ) @@ -56,9 +56,9 @@ func BoolValue(v bool) Value { //nolint:revive // Not a control flag. // changed after it is passed. 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. -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 // 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. func (v Value) AsBytes() []byte { return nil } // TODO (#4914): implement -// AsList returns the value held by v as a []Value. -func (v Value) AsList() []Value { return nil } // TODO (#4914): implement +// AsSlice returns the value held by v as a []Value. +func (v Value) AsSlice() []Value { return nil } // TODO (#4914): implement // AsMap returns the value held by v as a []KeyValue. 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. func Bytes(key string, v []byte) KeyValue { return KeyValue{} } // TODO (#4914): implement -// List returns an KeyValue for a []Value value. -func List(key string, args ...Value) KeyValue { return KeyValue{} } // TODO (#4914): implement +// Slice returns an KeyValue for a []Value value. +func Slice(key string, args ...Value) KeyValue { return KeyValue{} } // TODO (#4914): implement // Map returns an KeyValue for a map value. func Map(key string, args ...KeyValue) KeyValue { return KeyValue{} } // TODO (#4914): implement diff --git a/log/kind_string.go b/log/kind_string.go index c398fb472..bdfaa1866 100644 --- a/log/kind_string.go +++ b/log/kind_string.go @@ -14,13 +14,13 @@ func _() { _ = x[KindInt64-3] _ = x[KindString-4] _ = x[KindBytes-5] - _ = x[KindList-6] + _ = x[KindSlice-6] _ = 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 { if i < 0 || i >= Kind(len(_Kind_index)-1) {