MCPcopy Create free account
hub / github.com/astercloud/aster / GetIntParam

Function GetIntParam

pkg/tools/builtin/utils.go:37–44  ·  view source on GitHub ↗

GetIntParam 获取整数参数的通用函数

(input map[string]any, key string, defaultValue int)

Source from the content-addressed store, hash-verified

35
36// GetIntParam 获取整数参数的通用函数
37func GetIntParam(input map[string]any, key string, defaultValue int) int {
38 if value, exists := input[key]; exists {
39 if num, ok := value.(float64); ok {
40 return int(num)
41 }
42 }
43 return defaultValue
44}
45
46// GetBoolParam 获取布尔参数的通用函数
47func GetBoolParam(input map[string]any, key string, defaultValue bool) bool {

Callers 6

ExecuteMethod · 0.85
ExecuteMethod · 0.85
runTaskMethod · 0.85
ExecuteMethod · 0.85
ExecuteMethod · 0.85
ExecuteMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected