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

Function getStr

internal/auth/device_flow.go:278–285  ·  view source on GitHub ↗

getStr retrieves a string value from a map, returning an empty string if not found or not a string.

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

Source from the content-addressed store, hash-verified

276
277// getStr retrieves a string value from a map, returning an empty string if not found or not a string.
278func getStr(m map[string]interface{}, key string) string {
279 if v, ok := m[key]; ok {
280 if s, ok := v.(string); ok {
281 return s
282 }
283 }
284 return ""
285}
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 {

Callers 9

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

Calls

no outgoing calls

Tested by

no test coverage detected