Skip to content

Commit add7b45

Browse files
committed
cleanup
1 parent e81c189 commit add7b45

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

cli/remoteforward.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,18 @@ type cookieAddr struct {
2626
var remoteForwardRegexTCP = regexp.MustCompile(`^(\d+):(.+):(\d+)$`)
2727

2828
// remote_socket_path:local_socket_path (both absolute paths)
29-
var remoteForwardRegexUnixSocket = regexp.MustCompile(`^(\\.+):(\\.+)$`)
29+
var remoteForwardRegexUnixSocket = regexp.MustCompile(`^(\/.+):(\/.+)$`)
3030

3131
func remoteForwardTCP(flag string) bool {
32-
reg := remoteForwardRegexTCP.MatchString(flag)
33-
fmt.Println("remoteForwardTCP", reg)
34-
return reg
32+
return remoteForwardRegexTCP.MatchString(flag)
3533
}
3634

3735
func remoteForwardUnixSocket(flag string) bool {
38-
reg := remoteForwardRegexUnixSocket.MatchString(flag)
39-
fmt.Println("remoteForwardUnixSocket", reg)
40-
return reg
36+
return remoteForwardRegexUnixSocket.MatchString(flag)
4137
}
4238

4339
func validateRemoteForward(flag string) bool {
44-
return remoteForwardUnixSocket(flag) || remoteForwardTCP(flag)
40+
return remoteForwardTCP(flag) || remoteForwardUnixSocket(flag)
4541
}
4642

4743
func parseRemoteForwardTCP(matches []string) (net.Addr, net.Addr, error) {

0 commit comments

Comments
 (0)