MCPcopy Create free account
hub / github.com/brimdata/super / AsInt

Method AsInt

value.go:411–421  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

409}
410
411func (v *Value) AsInt() int64 {
412 if v != nil {
413 switch TypeUnder(v.Type()).(type) {
414 case *TypeOfUint8, *TypeOfUint16, *TypeOfUint32, *TypeOfUint64:
415 return int64(v.Uint())
416 case *TypeOfInt8, *TypeOfInt16, *TypeOfInt32, *TypeOfInt64:
417 return v.Int()
418 }
419 }
420 return 0
421}
422
423func (v *Value) AsTime() nano.Ts {
424 if v != nil && TypeUnder(v.Type()) == TypeTime {

Callers 4

getNumericIndexFunction · 0.80
TestReaderCRLFFunction · 0.80
TestNestedRecordsFunction · 0.80

Calls 4

TypeMethod · 0.95
UintMethod · 0.95
IntMethod · 0.95
TypeUnderFunction · 0.85

Tested by 2

TestReaderCRLFFunction · 0.64
TestNestedRecordsFunction · 0.64