Sanitize transforms a given string to not contain spaces or dashes, and to be in lower case.
(str string)
| 15 | |
| 16 | // Sanitize transforms a given string to not contain spaces or dashes, and to be in lower case. |
| 17 | func Sanitize(str string) string { |
| 18 | san := strings.ReplaceAll(str, " ", "_") |
| 19 | san = strings.ReplaceAll(san, "-", "_") |
| 20 | |
| 21 | return strings.ToLower(san) |
| 22 | } |
| 23 | |
| 24 | // Split trims and splits a provided string by comma. |
| 25 | func Split(str string) []string { |
no outgoing calls
no test coverage detected