Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Sanitize ¶
Sanitize sanitizes `str` by removing all characters satisfying `removePattern`. Returns an error if the pattern is not valid regex string.
func Snakecase ¶
Snakecase removes all non word characters and converts any english text into a snakecase. "ABBREVIATIONS" are preserved, eg. "myTestDB" will become "my_test_db".
func Usernamify ¶
Usernamify generates a properly formatted username from the provided string. Returns "unknown" if `str` is empty or contains only non word characters.
```go Usernamify("John Doe, hello") // "john.doe.hello" ```
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.