Total Lines | 10 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | package is |
||
2 | |||
3 | import "github.com/muonsoft/validation/validate" |
||
4 | |||
5 | // URL is used to check that value is a valid URL string. By default (if no schemas are passed), |
||
6 | // the function checks only for the http:// and https:// schemas. Use the schemas argument |
||
7 | // to configure the list of expected schemas. If an empty string is passed as a schema, then |
||
8 | // URL value may be treated as relative (without schema, e.g. "//example.com"). |
||
9 | func URL(value string, schemas ...string) bool { |
||
10 | return validate.URL(value, schemas...) == nil |
||
11 | } |
||
12 |