gitlab.com/evatix-go/core@v1.3.55/coreutils/stringutil/ToInt8.go (about) 1 package stringutil 2 3 import "strconv" 4 5 func ToInt8( 6 s string, 7 defVal int8, 8 ) int8 { 9 toInt, err := strconv.Atoi(s) 10 11 if err != nil { 12 return defVal 13 } 14 15 return int8(toInt) 16 }