Library that allows you to detect and avoid overflows in operations with integer numbers
Example:
package main
import (
"fmt"
"github.com/akramarenkov/safe"
)
func main() {
sum, err := safe.Add[int8](124, 3)
fmt.Println(err)
fmt.Println(sum)
sum, err = safe.Add[int8](125, 3)
fmt.Println(err)
fmt.Println(sum)
// Output:
// <nil>
// 127
// integer overflow
// 0
}