(val any)
| 1082 | } |
| 1083 | |
| 1084 | func newStatic(val any) Static { |
| 1085 | if val == nil { |
| 1086 | return NewStaticNil() |
| 1087 | } |
| 1088 | |
| 1089 | switch v := val.(type) { |
| 1090 | case int: |
| 1091 | return NewStaticInt(v) |
| 1092 | case float64: |
| 1093 | return NewStaticFloat(v) |
| 1094 | case string: |
| 1095 | return NewStaticString(v) |
| 1096 | case bool: |
| 1097 | return NewStaticBool(v) |
| 1098 | case time.Duration: |
| 1099 | return NewStaticDuration(v) |
| 1100 | case Status: |
| 1101 | return NewStaticStatus(v) |
| 1102 | case Kind: |
| 1103 | return NewStaticKind(v) |
| 1104 | case []int: |
| 1105 | return NewStaticIntArray(v) |
| 1106 | case []float64: |
| 1107 | return NewStaticFloatArray(v) |
| 1108 | case []string: |
| 1109 | return NewStaticStringArray(v) |
| 1110 | case []bool: |
| 1111 | return NewStaticBooleanArray(v) |
| 1112 | default: |
| 1113 | panic(fmt.Sprintf("unsupported type %T", val)) |
| 1114 | } |
| 1115 | } |
| 1116 | |
| 1117 | func testName(val any) string { |
| 1118 | if val == nil { |
no test coverage detected