package match import "net" func onlyHost(name string) string { host, _, err := net.SplitHostPort(name) if err != nil { return name } return host }