buildkit/util/sshutil/transport_validation.go

12 lines
197 B
Go

package sshutil
import (
"regexp"
)
var gitSSHRegex = regexp.MustCompile("^[a-zA-Z0-9-_]+@[a-zA-Z0-9-.]+:.*$")
func IsImplicitSSHTransport(s string) bool {
return gitSSHRegex.MatchString(s)
}