style: rename controllers to login, cancel internal/pkg

This commit is contained in:
Mmx
2024-10-14 12:50:59 +08:00
parent e963917d87
commit 20c4d3df55
14 changed files with 31 additions and 31 deletions

View File

@@ -0,0 +1,18 @@
package dnsUtil
import (
"errors"
"strings"
)
func DecodeDomain(domain string) (subStr string, rootDomain string, e error) {
t := strings.Split(domain, ".")
if len(t) == 1 {
return "", "", errors.New("域名不合法")
} else if len(t) == 2 {
return "@", domain, nil
}
l := len(t)
return strings.Join(t[:l-2], "."), strings.Join(t[l-2:l], "."), nil
}