11 lines
209 B
Go
11 lines
209 B
Go
|
package common
|
||
|
|
||
|
import "strings"
|
||
|
|
||
|
func StrToSnakeCase(s string) string {
|
||
|
snake := strings.ToLower(s)
|
||
|
snake = strings.ReplaceAll(snake, " ", "_")
|
||
|
snake = strings.ReplaceAll(snake, "\t", "_")
|
||
|
return snake
|
||
|
}
|