func StringToUInt16(s string, def uint16) uint16 {
	v, err := strconv.ParseInt(s, 10, 32)
	if err != nil {
		log.Warnf("failed to parse uint16 value: %s", s)
		return def
	}
	return uint16(v)
}
StringToUInt16 converts a string to a uint16 returning a default value on failure
package util
import (
	"github.com/pkg/errors"
	log "github.com/sirupsen/logrus"
	"regexp"
	"strconv"
	"time"
)
func StringToInt16(s string, def int16) int16 {
	v, err := strconv.ParseInt(s, 10, 16)
	if err != nil {
		log.Warnf("failed to parse int16 value from redis: %s", s)
		return def
	}
	return int16(v)
}