File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed
Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -14,17 +14,21 @@ import (
1414const (
1515 // MinInt16 defines the minimum integer value for an int16
1616 MinInt16 = - 1 << 15 // -32768
17+
1718 // MaxInt16 defines the maximum integer value for an int16
1819 MaxInt16 = 1 << 15 - 1 // 32767
1920)
2021
2122var (
2223 // ErrValueOutOfRange defines when a value is out of range
2324 ErrValueOutOfRange = errors .New ("value out of range" )
25+
2426 // ErrValueOverflow defines when a value is overflowing the data type
2527 ErrValueOverflow = errors .New ("value overflow" )
28+
2629 // ErrNegativeValueCannotBeConverted defines when a negative value is trying to be used with an unsigned integer
2730 ErrNegativeValueCannotBeConverted = errors .New ("negative value cannot be converted to unsigned integer" )
31+
2832 // ErrValueExceedsLimit defines when a converted value exceeds the limit of the data type
2933 ErrValueExceedsLimit = errors .New ("value exceeds limit" )
3034)
Original file line number Diff line number Diff line change 1+ // Package safeconversion_test provides tests for the safe conversion functions.
12package safeconversion_test
23
34import (
You can’t perform that action at this time.
0 commit comments