Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
21 lines (16 sloc) 328 Bytes
package validators
import (
"strings"
"github.com/serenize/snaker"
)
var CustomKeys = map[string]string{}
func GenerateKey(s string) string {
key := CustomKeys[s]
if key != "" {
return key
}
key = strings.Replace(s, " ", "", -1)
key = strings.Replace(key, "-", "", -1)
key = snaker.CamelToSnake(key)
return key
}
You can’t perform that action at this time.