(key string, val any)
| 2033 | } |
| 2034 | |
| 2035 | func attr(key string, val any) Attribute { |
| 2036 | switch val := val.(type) { |
| 2037 | case string: |
| 2038 | return Attribute{Key: key, Value: []string{val}, IsArray: false} |
| 2039 | case []string: |
| 2040 | return Attribute{Key: key, Value: val, IsArray: true} |
| 2041 | case int: |
| 2042 | return Attribute{Key: key, ValueInt: []int64{int64(val)}, IsArray: false} |
| 2043 | case []int64: |
| 2044 | return Attribute{Key: key, ValueInt: val, IsArray: true} |
| 2045 | case float64: |
| 2046 | return Attribute{Key: key, ValueDouble: []float64{val}, IsArray: false} |
| 2047 | case []float64: |
| 2048 | return Attribute{Key: key, ValueDouble: val, IsArray: true} |
| 2049 | case bool: |
| 2050 | return Attribute{Key: key, ValueBool: []bool{val}, IsArray: false} |
| 2051 | case []bool: |
| 2052 | return Attribute{Key: key, ValueBool: val, IsArray: true} |
| 2053 | default: |
| 2054 | panic(fmt.Sprintf("type %T not supported for attribute '%s'", val, key)) |
| 2055 | } |
| 2056 | } |
| 2057 | |
| 2058 | func TestDescendantOf(t *testing.T) { |
| 2059 | ancestor1 := &span{nestedSetLeft: 3, nestedSetRight: 8} |
no outgoing calls
no test coverage detected