Passed
Push — main ( add42e...815f74 )
by Rushan
02:28 queued 12s
created

is.URL   A

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 2
dl 0
loc 2
rs 10
c 0
b 0
f 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