variable declaration cleanup
Docker-DCO-1.1-Signed-off-by: Daniel Norberg <daniel.norberg@gmail.com> (github: danielnorberg)
Upstream-commit: 5684997e54
Component: cli
This commit is contained in:
committed by
Vincent Demeester
parent
261c179e16
commit
f2632ce254
@ -143,7 +143,7 @@ func ValidateDomain(val string) (string, error) {
|
||||
return "", fmt.Errorf("%s is not a valid domain", val)
|
||||
}
|
||||
re := regexp.MustCompile(`^(:?(:?[a-zA-Z0-9]|(:?[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9]))(:?\.(:?[a-zA-Z0-9]|(:?[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])))*)\.?\s*$`)
|
||||
var ns = re.FindSubmatch([]byte(val))
|
||||
ns := re.FindSubmatch([]byte(val))
|
||||
if len(ns) > 0 {
|
||||
return string(ns[1]), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user