func ParseAndExecTemplateFromString(s string, data interface{}) (string, error) {
	var buf bytes.Buffer
	t, err := template.New("test").Funcs(NewFuncMap()).Parse(s)
	if err != nil {
		return "", err
	}
	err = t.Execute(&buf, data)
	if err != nil {
		return "", err
	}
	return buf.String(), nil
}
ParseAndExecTemplateFromString parses string, creates template and exeutes, returns resulting string
package utils
import (
	"bytes"
	"encoding/base64"
	"fmt"
	"github.com/google/uuid"
	"golang.org/x/crypto/bcrypt"
	"gopkg.in/guregu/null.v3"
	html "html/template"
	"reflect"
	"regexp"
	"strconv"
	"strings"
	"text/template"
	"time"
)
func HashPassword(password string, cost int) string {
	hash, _ := bcrypt.GenerateFromPassword([]byte(password), cost)
	return string(hash)
}
func ComparePassword(hashPassword []byte, rawPassword []byte) error {
	return bcrypt.CompareHashAndPassword(hashPassword, rawPassword)
}
var matchFirstCap = regexp.MustCompile("(.)([A-Z][a-z]+)")
var matchAllCap = regexp.MustCompile("([a-z0-9])([A-Z])")
func ToSnakeCase(str string) string {
	snake := matchFirstCap.ReplaceAllString(str, "${1}_${2}")
	snake = matchAllCap.ReplaceAllString(snake, "${1}_${2}")
	return strings.ToLower(snake)
}
func InArray(val interface{}, array interface{}) (exists bool, index int) {
	exists = false
	index = -1
	switch reflect.TypeOf(array).Kind() {
	case reflect.Slice:
		s := reflect.ValueOf(array)
		for i := 0; i < s.Len(); i++ {
			if reflect.DeepEqual(val, s.Index(i).Interface()) == true {
				index = i
				exists = true
				return
			}
		}
	}
	return
}