Check if the string is empty.
This commit is contained in:
parent
b0c068e420
commit
e78a7436aa
|
@ -10,10 +10,12 @@ package dns
|
|||
// www.miek.nl. returns []string{"www", "miek", "nl"}
|
||||
// The root label (.) returns nil.
|
||||
func SplitDomainName(s string) (labels []string) {
|
||||
if len(s) == 0 {
|
||||
return nil
|
||||
}
|
||||
fqdnEnd := 0 // offset of the final '.' or the length of the name
|
||||
idx := Split(s)
|
||||
begin := 0
|
||||
|
||||
if s[len(s)-1] == '.' {
|
||||
fqdnEnd = len(s) - 1
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue