(key string, val any)
| 1783 | } |
| 1784 | |
| 1785 | func attr(key string, val any) Attribute { |
| 1786 | switch val := val.(type) { |
| 1787 | case string: |
| 1788 | return Attribute{Key: key, Value: []string{val}, IsArray: false} |
| 1789 | case []string: |
| 1790 | return Attribute{Key: key, Value: val, IsArray: true} |
| 1791 | case int: |
| 1792 | return Attribute{Key: key, ValueInt: []int64{int64(val)}, IsArray: false} |
| 1793 | case []int64: |
| 1794 | return Attribute{Key: key, ValueInt: val, IsArray: true} |
| 1795 | case float64: |
| 1796 | return Attribute{Key: key, ValueDouble: []float64{val}, IsArray: false} |
| 1797 | case []float64: |
| 1798 | return Attribute{Key: key, ValueDouble: val, IsArray: true} |
| 1799 | case bool: |
| 1800 | return Attribute{Key: key, ValueBool: []bool{val}, IsArray: false} |
| 1801 | case []bool: |
| 1802 | return Attribute{Key: key, ValueBool: val, IsArray: true} |
| 1803 | default: |
| 1804 | panic(fmt.Sprintf("type %T not supported for attribute '%s'", val, key)) |
| 1805 | } |
| 1806 | } |
| 1807 | |
| 1808 | func TestDescendantOf(t *testing.T) { |
| 1809 | ancestor1 := &span{nestedSetLeft: 3, nestedSetRight: 8} |
no outgoing calls
no test coverage detected