import (
"internal/bytealg"
+ "internal/stringslite"
"net/netip"
"time"
)
case "options": // magic options
for _, s := range f[1:] {
switch {
- case hasPrefix(s, "ndots:"):
+ case stringslite.HasPrefix(s, "ndots:"):
n, _, _ := dtoi(s[6:])
if n < 0 {
n = 0
n = 15
}
conf.ndots = n
- case hasPrefix(s, "timeout:"):
+ case stringslite.HasPrefix(s, "timeout:"):
n, _, _ := dtoi(s[8:])
if n < 1 {
n = 1
}
conf.timeout = time.Duration(n) * time.Second
- case hasPrefix(s, "attempts:"):
+ case stringslite.HasPrefix(s, "attempts:"):
n, _, _ := dtoi(s[9:])
if n < 1 {
n = 1
return nil
}
-func hasPrefix(s, prefix string) bool {
- return len(s) >= len(prefix) && s[:len(prefix)] == prefix
-}
-
func ensureRooted(s string) string {
if len(s) > 0 && s[len(s)-1] == '.' {
return s