aboutsummaryrefslogtreecommitdiff
path: root/internal/intconv/i64_u64.go
blob: c04da3cd10ab9da4617c148f84559b13b31e1642 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
package intconv

// Int64ToUint64 converts v to uint64, returning an error if v is negative.
func Int64ToUint64(v int64) (uint64, error) {
	if v < 0 {
		return 0, ErrOverflow
	}

	return uint64(v), nil
}