| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -552,17 +552,6 @@ func parseGCPSSHCmd(instance string) (ip, sshFlags string, err error) { | |||
| 552 | 552 | ||
| 553 | 553 | // E.g. foo@1.2.3.4. | |
| 554 | 554 | userIP := toks[len(toks)-1] | |
| 555 | - toks = strings.Split(userIP, "@") | ||
| 556 | - // Assume the '<user>@' is missing. | ||
| 557 | - if len(toks) < 2 { | ||
| 558 | - ip = strings.TrimSpace(toks[0]) | ||
| 559 | - } else { | ||
| 560 | - ip = strings.TrimSpace(toks[1]) | ||
| 561 | - } | ||
| 562 | - | ||
| 563 | - if net.ParseIP(ip) == nil { | ||
| 564 | - return "", "", xerrors.Errorf("parsed invalid ip address %v", ip) | ||
| 565 | - } | ||
| 566 | 555 | ||
| 567 | - return ip, sshFlags, nil | ||
| 556 | + return strings.TrimSpace(userIP), sshFlags, nil | ||
| 568 | 557 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments