(value interface{}, defaultValue int)
| 1446 | } |
| 1447 | |
| 1448 | func parseIntValue(value interface{}, defaultValue int) int { |
| 1449 | switch v := value.(type) { |
| 1450 | case int: |
| 1451 | return v |
| 1452 | case int32: |
| 1453 | return int(v) |
| 1454 | case int64: |
| 1455 | return int(v) |
| 1456 | case float32: |
| 1457 | return int(v) |
| 1458 | case float64: |
| 1459 | return int(v) |
| 1460 | case string: |
| 1461 | parsed, err := strconv.Atoi(strings.TrimSpace(v)) |
| 1462 | if err == nil { |
| 1463 | return parsed |
| 1464 | } |
| 1465 | } |
| 1466 | return defaultValue |
| 1467 | } |
| 1468 | |
| 1469 | func paginateReadFileContent(content string, args map[string]interface{}) string { |
| 1470 | const readFileMaxChars = 50000 |
no test coverage detected