Skip to content

Commit f56f194

Browse files
committed
Created Empty() function for URLSet
1 parent 70fc7e4 commit f56f194

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

urls.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@ import (
66
)
77

88
func (s URLSet) First() *url.URL {
9-
if len(s) == 0 {
9+
if s.Empty() {
1010
return nil
1111
}
1212
return s[0]
1313
}
1414

15+
func (s URLSet) Empty() bool {
16+
return len(s) == 0
17+
}
18+
1519
func appendURL(target *URLSet, value string) error {
1620
u, err := url.Parse(value)
1721
if err != nil || u.Scheme == "" || u.Host == "" {

0 commit comments

Comments
 (0)