All the bytesTo* functions defined below assume the value is a byte-slice. Converts untyped value into int. The bool return implies success - it returns false only if there is a conversion failure.
()
| 673 | // Converts untyped value into int. The bool return implies success - |
| 674 | // it returns false only if there is a conversion failure. |
| 675 | func (v Value) bytesToInt() (int64, bool) { |
| 676 | bytes, _ := v.ToBytes() |
| 677 | i, err := strconv.ParseInt(strings.TrimSpace(string(bytes)), 10, 64) |
| 678 | return i, err == nil |
| 679 | } |
| 680 | |
| 681 | // Converts untyped value into float. The bool return implies success |
| 682 | // - it returns false only if there is a conversion failure. |