Files
cloudly-min/.rclone_repo/vendor/github.com/pengsrc/go-shared/check/host.go
2020-01-13 03:37:51 +00:00

12 lines
247 B
Go
Executable File

package check
import (
"regexp"
)
// HostAndPort checks whether a string contains host and port.
// It returns true if matched.
func HostAndPort(hostAndPort string) bool {
return regexp.MustCompile(`^[^:]+:[0-9]+$`).MatchString(hostAndPort)
}