Type returns the type of the value.
()
| 282 | |
| 283 | // Type returns the type of the value. |
| 284 | func (v *Value) Type() Type { |
| 285 | switch { |
| 286 | case v.IsString(): |
| 287 | return TypeString |
| 288 | case v.IsInt(): |
| 289 | return TypeInt |
| 290 | case v.IsFloat(): |
| 291 | return TypeFloat |
| 292 | case v.IsBool(): |
| 293 | return TypeBool |
| 294 | case v.IsMap(): |
| 295 | return TypeMap |
| 296 | case v.IsSlice(): |
| 297 | return TypeSlice |
| 298 | case v.IsNull(): |
| 299 | return TypeNull |
| 300 | default: |
| 301 | return TypeUnknown |
| 302 | } |
| 303 | } |
| 304 | |
| 305 | func (v *Value) IsScalar() bool { |
| 306 | unpacked := v.UnpackKinds(reflect.Interface, reflect.Pointer) |