Documentation
¶
Overview ¶
Package inflect provides minimal, allocation-conscious string transformations used across the framework (snake_case, plural table names, etc.). It is intentionally small: callers may register irregulars at init time.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForeignKey ¶
ForeignKey returns the conventional foreign-key column for a struct name. e.g. "User" -> "user_id".
func Pascal ¶
Pascal converts snake_case to PascalCase. If the input already looks like CamelCase or PascalCase (no underscores, contains at least one uppercase letter), the existing casing is preserved and only the first character is upper-cased. This avoids destroying acronyms or compound names like "TagService" or "HTTPRequest" when the CLI re-normalizes user-supplied identifiers.
func RegisterIrregular ¶
func RegisterIrregular(singular, plural string)
RegisterIrregular adds or overrides an irregular plural mapping.
func Singularize ¶
Singularize returns the singular form of word (best-effort).
Types ¶
This section is empty.