fix: synchronize update the syncers (#2201)

Signed-off-by: baihhh <2542274498@qq.com>
This commit is contained in:
Baihhh
2023-08-13 22:24:34 +08:00
committed by Yang Luo
parent db4ac60bb6
commit 80b0d26813
6 changed files with 138 additions and 41 deletions

View File

@ -88,6 +88,17 @@ func CamelToSnakeCase(camel string) string {
return strings.ReplaceAll(buf.String(), " ", "")
}
func SnakeToCamel(snake string) string {
words := strings.Split(snake, "_")
for i := range words {
words[i] = strings.ToLower(words[i])
if i > 0 {
words[i] = strings.Title(words[i])
}
}
return strings.Join(words, "")
}
func GetOwnerAndNameFromId(id string) (string, string) {
tokens := strings.Split(id, "/")
if len(tokens) != 2 {