func IsNumeric(val string) bool {
	if len(val) == 0 {
		return true
	}
	regexNumeric := regexp.MustCompile("^[0-9]+$")
	return regexNumeric.MatchString(val)
}
IsNumeric check if the string contains only numbers. Empty string is valid.
package validationhelper
import (
	"regexp"
)