updated regex to be more concise
This commit is contained in:
parent
b296f56e2a
commit
d4eba2ba44
@ -54,7 +54,7 @@ func (h *Halo) sendRequest(url string) ([]byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func verifyValidID(id string) error {
|
func verifyValidID(id string) error {
|
||||||
re, _ := regexp.Compile("^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$")
|
re, _ := regexp.Compile("^\\w{8}-\\w{4}-\\w{4}-\\w{4}-\\w{12}$")
|
||||||
if !re.MatchString(id) {
|
if !re.MatchString(id) {
|
||||||
return fmt.Errorf("Not a Valid id: ", id)
|
return fmt.Errorf("Not a Valid id: ", id)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user