feat: add regex support for account item (#2714)

* feat: add regex support for account item

* feat: use reflect to process user field

* fix: fix lint problem

* feat: improve code format and fix reflect error
This commit is contained in:
DacongDA
2024-02-17 15:24:36 +08:00
committed by GitHub
parent 4a68dd65cd
commit d731c3c934
52 changed files with 336 additions and 39 deletions

View File

@ -113,6 +113,15 @@ func SnakeToCamel(snake string) string {
return strings.Join(words, "")
}
func SpaceToCamel(name string) string {
words := strings.Split(name, " ")
for i := range words {
words[i] = strings.ToLower(words[i])
words[i] = strings.Title(words[i])
}
return strings.Join(words, "")
}
func GetOwnerAndNameFromId(id string) (string, string) {
tokens := strings.Split(id, "/")
if len(tokens) != 2 {