Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove #2109

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions api/controller/apigateway/api_gateway_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,18 @@ func (g Struct) DeleteTCPRoute(w http.ResponseWriter, r *http.Request) {
}

func removeLeadingDigits(name string) string {
// 使用正则表达式匹配前面的数字
// 使用正则表达式移除开头的数字
re := regexp.MustCompile(`^\d+`)
// 将匹配到的数字替换为空字符串
return re.ReplaceAllString(name, "")
name = re.ReplaceAllString(name, "")

// 按照 "-" 切割
parts := strings.Split(name, "-")

// 如果切割后长度小于等于1,直接返回空字符串
if len(parts) <= 1 {
return ""
}

// 移除最后一个部分并重新拼接
return strings.Join(parts[:len(parts)-1], "-")
}
Empty file added build.sh
Empty file.
Loading