| 518 | } |
| 519 | |
| 520 | func (b *ValueBinder) intValue(sourceParam string, dest any, bitSize int, valueMustExist bool) *ValueBinder { |
| 521 | if b.failFast && b.errors != nil { |
| 522 | return b |
| 523 | } |
| 524 | |
| 525 | value := b.ValueFunc(sourceParam) |
| 526 | if value == "" { |
| 527 | if valueMustExist { |
| 528 | b.setError(b.ErrorFunc(sourceParam, []string{}, "required field value is empty", nil)) |
| 529 | } |
| 530 | return b |
| 531 | } |
| 532 | |
| 533 | return b.int(sourceParam, value, dest, bitSize) |
| 534 | } |
| 535 | |
| 536 | func (b *ValueBinder) int(sourceParam string, value string, dest any, bitSize int) *ValueBinder { |
| 537 | n, err := strconv.ParseInt(value, 10, bitSize) |