func ReplaceSuffix(in, suffix, replace string) string {
	if strings.HasSuffix(in, suffix) {
		in = in[:len(in)-len(suffix)] + replace
	}
	return in
}
ReplaceSuffix replaces substring on the end of string
package util
import (
	"regexp"
	"strings"
	"unicode"
	"unicode/utf8"
	"github.com/fatih/camelcase"
	"github.com/jinzhu/inflection"
)
const (
	Id = "Id"
	Ids = "Ids"
	ID = "ID"
	IDs = "IDs"
	Rel = "Rel"
)
func init() {
	inflection.AddUncountable("sms", "mms", "rls")
}
func Singular(s string) string {
	return inflection.Singular(s)
}
func IsUpper(c byte) bool {
	return c >= 'A' && c <= 'Z'
}
func IsLower(c byte) bool {
	return c >= 'a' && c <= 'z'
}
func ToUpper(c byte) byte {
	return c - 32
}
func ToLower(c byte) byte {
	return c + 32
}
func CamelCased(s string) string {
	r := make([]byte, 0, len(s))
	upperNext := true
	for i := 0; i < len(s); i++ {
		c := s[i]
		if c == '_' {
			upperNext = true
			continue
		}
		if upperNext {
			if IsLower(c) {
				c = ToUpper(c)
			}
			upperNext = false
		}
		r = append(r, c)
	}
	return string(r)
}
func Underscore(s string) string {
	r := make([]byte, 0, len(s)+5)
	for i := 0; i < len(s); i++ {
		c := s[i]
		if IsUpper(c) {
			if i > 0 && i+1 < len(s) && (IsLower(s[i-1]) || IsLower(s[i+1])) {
				r = append(r, '_', ToLower(c))
			} else {
				r = append(r, ToLower(c))
			}
		} else {
			r = append(r, c)
		}
	}
	return string(r)
}
func Sanitize(s string) string {
	rgxp := regexp.MustCompile(`[^a-zA-Z\d\-_]`)
	sanitized := strings.Replace(rgxp.ReplaceAllString(s, ""), "-", "_", -1)
	if len(sanitized) != 0 && ((sanitized[0] >= '0' && sanitized[0] <= '9') || sanitized[0] == '_') {
		sanitized = "T" + sanitized
	}
	return sanitized
}
func PackageName(s string) string {
	return strings.ToLower(Sanitize(s))
}
func EntityName(s string) string {
	splitted := camelcase.Split(CamelCased(Sanitize(s)))
	ln := len(splitted) - 1
	for i := ln; i >= 0; i-- {
		split := splitted[i]
		singular := Singular(split)
		if strings.ToLower(singular) != strings.ToLower(split) {
			splitted[i] = strings.Title(singular)
			break
		}
	}
	return strings.Join(splitted, "")
}
func ColumnName(s string) string {
	camelCased := CamelCased(Sanitize(s))
	camelCased = ReplaceSuffix(ReplaceSuffix(camelCased, Id, ID), Ids, IDs)
	return strings.Title(camelCased)
}
func HasUpper(s string) bool {
	for i := 0; i < len(s); i++ {
		c := s[i]
		if IsUpper(c) {
			return true
		}
	}
	return false
}