MCPcopy Create free account
hub / github.com/MMadmer/EpicAssetsNotifyBot / asInt

Function asInt

internal/app/bootstrap.go:297–311  ·  view source on GitHub ↗
(value any)

Source from the content-addressed store, hash-verified

295}
296
297func asInt(value any) (int, bool) {
298 switch typed := value.(type) {
299 case int:
300 return typed, true
301 case int64:
302 return int(typed), true
303 case float64:
304 return int(typed), typed == float64(int(typed))
305 case json.Number:
306 number, err := typed.Int64()
307 return int(number), err == nil
308 default:
309 return 0, false
310 }
311}
312
313func cloneInt64Ptr(value *int64) *int64 {
314 if value == nil {

Callers 1

mapDeadlineInfoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected