diff --git a/tools/component/component.go b/tools/component/component.go index f71fd18c8..9aecfa704 100644 --- a/tools/component/component.go +++ b/tools/component/component.go @@ -120,24 +120,20 @@ func main() { os.Exit(1) } -func extractHost(urlStr string) (string, error) { - u, err := url.Parse(urlStr) - if err != nil { - return "", fmt.Errorf("unable to parse URL: %w", err) - } - +func exactIP(urll string) string { + u, _ := url.Parse(urll) host, _, err := net.SplitHostPort(u.Host) if err != nil { host = u.Host } - if strings.HasSuffix(host, ":") { - host = host[:len(host)-1] + host = host[0 : len(host)-1] } - - return host, nil + + return host } + func checkMysql() error { var sqlDB *sql.DB defer func() {