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