MCPcopy
hub / github.com/larksuite/cli / getInt

Function getInt

internal/auth/device_flow.go:288–298  ·  view source on GitHub ↗

getInt retrieves an integer value from a map, returning a fallback value if not found or not a number.

(m map[string]interface{}, key string, fallback int)

Source from the content-addressed store, hash-verified

286
287// getInt retrieves an integer value from a map, returning a fallback value if not found or not a number.
288func getInt(m map[string]interface{}, key string, fallback int) int {
289 if v, ok := m[key]; ok {
290 switch n := v.(type) {
291 case float64:
292 return int(n)
293 case int:
294 return n
295 }
296 }
297 return fallback
298}

Callers 7

RevokeTokenFunction · 0.85
doRefreshTokenFunction · 0.85
tryHandleMCPResponseMethod · 0.85
tryHandleOAPIResponseMethod · 0.85
RequestAppRegistrationFunction · 0.85
PollDeviceTokenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected