mirror of
https://github.com/ent/ent.git
synced 2026-05-22 09:31:45 +03:00
entc/gen: support custom Acronym (#2900)
This commit is contained in:
@@ -291,12 +291,20 @@ func ruleset() *inflect.Ruleset {
|
||||
"TLS", "TTL", "UDP", "UI", "UID", "URI", "URL", "UTF8", "UUID", "VM",
|
||||
"XML", "XMPP", "XSRF", "XSS",
|
||||
} {
|
||||
acronyms[w] = struct{}{}
|
||||
rules.AddAcronym(w)
|
||||
addAcronym(rules, w)
|
||||
}
|
||||
return rules
|
||||
}
|
||||
|
||||
func addAcronym(rules *inflect.Ruleset, word string) {
|
||||
acronyms[word] = struct{}{}
|
||||
rules.AddAcronym(word)
|
||||
}
|
||||
|
||||
func AddAcronym(word string) {
|
||||
addAcronym(rules, word)
|
||||
}
|
||||
|
||||
// order returns a map of sort orders.
|
||||
// The key is the function name, and the value its database keyword.
|
||||
func order() map[string]string {
|
||||
|
||||
Reference in New Issue
Block a user