MCPcopy Create free account
hub / github.com/ForestHubAI/edge-agents / AsInt

Method AsInt

go/engine/expr/value.go:48–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

46 return BoolVal(false)
47 case workflowapi.Image:
48 return ImageVal(nil)
49 default:
50 return StringVal("")
51 }
52}
53
54func (v Value) AsInt() int64 {
55 switch r := v.Raw.(type) {
56 case int64:
57 return r
58 case float64:
59 return int64(r)
60 case bool:
61 if r {
62 return 1
63 }
64 return 0
65 case string:
66 n, _ := strconv.ParseInt(r, 10, 64)
67 return n
68 default:

Callers 6

CastMethod · 0.95
TestFunction_CallFunction · 0.80
valueToLiteralFunction · 0.80
parseAddSubMethod · 0.80
parseMulDivMethod · 0.80
parseUnaryMethod · 0.80

Calls

no outgoing calls

Tested by 1

TestFunction_CallFunction · 0.64